Method and software for multithreaded processor with partitioned operations

ABSTRACT

A system and software for improving the performance of processors by incorporating an execution unit configurable to execute a plurality of instruction streams from the plurality of threads, wherein each instruction stream includes a group instruction that operates on a plurality of data elements in partitioned fields of at least one of the registers to produce a catenated result.

RELATED APPLICATIONS

[0001] This application is a continuation of U.S. patent applicationSer. No. 10/646,787, filed Aug. 25, 2003, which is a continuation ofU.S. patent application Ser. No. 09/922,319, filed Aug. 2, 2001, whichis a continuation of U.S. patent application Ser. No. 09/382,402, filedAug. 24, 1999, now U.S. Pat. No. 6,295,599, which claims the benefit ofpriority to Provisional Application No. 60/097,635 filed Aug. 24, 1998,and is a continuation-in-part of U.S. patent application Ser. No.09/169,963, filed Oct. 13, 1998, now U.S. Pat. No. 6,006,318, which is acontinuation of U.S. patent application Ser. No. 08/754,827, filed Nov.22, 1996 now U.S. Pat. No. 5,822,603, which is a divisional of U.S.patent application Ser. No. 08/516,036, filed Aug. 16, 1995 now U.S.Pat. No. 5,742,840.

REFERENCE TO PARENT APPLICATIONS

[0002] The contents of U.S. patent application Ser. Nos. 09/382,402 and09/922,319 are hereby incorporated by reference including theirappendices in their entirety.

REFERENCE TO AN APPENDIX

[0003] This application includes an appendix, submitted herewith. Thecontents of the appendix are hereby incorporated by reference.

FIELD OF THE INVENTION

[0004] The present invention relates to general purpose processorarchitectures, and particularly relates to general purpose processorarchitectures capable of executing group operations.

BACKGROUND OF THE INVENTION

[0005] The performance level of a processor, and particularly a generalpurpose processor, can be estimated from the multiple of a plurality ofinterdependent factors: clock rate, gates per clock, number of operands,operand and data path width, and operand and data path partitioning.Clock rate is largely influenced by the choice of circuit and logictechnology, but is also influenced by the number of gates per clock.Gates per clock is how many gates in a pipeline may change state in asingle clock cycle. This can be reduced by inserting latches into thedata path: when the number of gates between latches is reduced, a higherclock is possible. However, the additional latches produce a longerpipeline length, and thus come at a cost of increased instructionlatency. The number of operands is straightforward; for example, byadding with carry-save techniques, three values may be added togetherwith little more delay than is required for adding two values. Operandand data path width defines how much data can be processed at once;wider data paths can perform more complex functions, but generally thiscomes at a higher implementation cost. Operand and data pathpartitioning refers to the efficient use of the data path as width isincreased, with the objective of maintaining substantially peak usage.

SUMMARY OF THE INVENTION

[0006] Embodiments of the invention pertain to systems and methods forenhancing the utilization of a general purpose processor by addingclasses of instructions. These classes of instructions use the contentsof general purpose registers as data path sources, partition theoperands into symbols of a specified size, perform operations inparallel, catenate the results and place the catenated results into ageneral-purpose register. Some embodiments of the invention relate to ageneral purpose microprocessor which has been optimized for processingand transmitting media data streams through significant parallelism.

[0007] Some embodiments of the present invention provide a system andmethod for improving the performance of general purpose processors byincluding the capability to execute group operations involving multiplefloating-point operands. In one embodiment, a programmable mediaprocessor comprises a virtual memory addressing unit, a data path, aregister file comprising a plurality of registers coupled to the datapath, and an execution unit coupled to the data path capable ofexecuting group-floating point operations in which multiplefloating-point operations stored in partitioned fields of one or more ofthe plurality of registers are operated on to produce catenated results.The group floating-point operations may involve operating on at leasttwo of the multiple floating-point operands in parallel. The catenatedresults may be returned to a register, and general purpose registers mayused as operand and result registers for the floating-point operations.In some embodiments the execution unit may also be capable of performinggroup floating-point operations on floating-point data of more than oneprecision. In some embodiments the group floating-point operations mayinclude group add, group subtract, group compare, group multiply andgroup divide arithmetic operations that operate on catenatedfloating-point data. In some embodiments, the group floating-pointoperations may include group multiply-add, group scale-add, and groupset operations that operate on catenated floating-point data.

[0008] In one embodiment, the execution unit is also capable ofexecuting group integer instructions involving multiple integer operandsstored in partitioned fields of registers. The group integer operationsmay involve operating on at least two of the multiple integer operandsin parallel. The group integer operations may include group add, groupsubtract, group compare, and group multiply arithmetic operations thatoperate on catenated integer data.

[0009] In one embodiment, the execution unit is capable of performinggroup data handling operations, including operations that copy,operations that shift, operations that rearrange and operations thatresize catenated integer data stored in a register and return catenatedresults. The execution unit may also be configurable to perform groupdata handling operations on integer data having a symbol width of 8bits, group data handling operations on integer data having a symbolwidth of 16 bits, and group data handling operations on integer datahaving a symbol width of 32 bits. In one embodiment, the operations arecontrolled by values in a register operand. In one embodiment, theoperations are controlled by values in the instruction.

[0010] In one embodiment, the multi-precision execution unit is capableof executing a Galois field instruction operation.

[0011] In one embodiment, the multi-precision execution unit isconfigurable to execute a plurality of instruction streams in parallelfrom a plurality of threads, and the programmable media processorfurther comprises a register file associated with each thread executingin parallel on the multi-precision execution unit to support processingof the plurality of threads. In some embodiments, the multi-precisionexecution unit executes instructions from the plurality of instructionstreams in a round-robin manner. In some embodiments, the processorensures only one thread from the plurality of threads can handle anexception at any given time.

[0012] Some embodiments of the present invention provide a multiplierarray that is fully used for high precision arithmetic, but is onlypartly used for other, lower precision operations. This can beaccomplished by extracting the high-order portion of the multiplierproduct or sum of products, adjusted by a dynamic shift amount from ageneral register or an adjustment specified as part of the instruction,and rounded by a control value from a register or instruction portion.The rounding may be any of several types, includinground-to-nearest/even; toward zero, floor, or ceiling. Overflows aretypically handled by limiting the result to the largest and smallestvalues that can be accurately represented in the output result.

[0013] When an extract is controlled by a register, the size of theresult can be specified, allowing rounding and limiting to a smallernumber of bits than can fit in the result. This permits the result to bescaled for use in subsequent operations without concern of overflow orrounding. As a result, performance is enhanced. In those instances wherethe extract is controlled by a register, a single register value definesthe size of the operands, the shift amount and size of the result, andthe rounding control. By placing such control information in a singleregister, the size of the instruction is reduced over the number of bitsthat such an instruction would otherwise require, again improvingperformance and enhancing processor flexibility. Exemplary instructionsare Ensemble Convolve Extract, Ensemble Multiply Extract, EnsembleMultiply Add Extract, and Ensemble Scale Add Extract. With particularregard to the Ensemble Scale Add Extract Instruction, the extractcontrol information is combined in a register with two values used asscalar multipliers to the contents of two vector multiplicands. Thiscombination reduces the number of registers otherwise required, thusreducing the number of bits required for the instruction.

[0014] In one embodiment, the processor performs load and storeinstructions operable to move values between registers and memory. Inone embodiment, the processor performs both instructions that verifyalignment of memory operands and instructions that permit memoryoperands to be unaligned. In one embodiment, the processor performsstore multiplex instructions operable to move to memory a portion ofdata contents controlled by a corresponding mask contents. In oneembodiment, this masked storage operation is performed by indivisiblyreading-modifying-writing a memory operand.

[0015] In one embodiment, all processor, memory and interface resourcesare directly accessible to high-level language programs. In oneembodiment, assembler codes and high-level language formats arespecified to access enhanced instructions. In one embodiment interfaceand system state is memory mapped, so that it can be manipulated bycompiled code. In one embodiment, software libraries provide otheroperations required by the ANSI/IEEE floating-point standard. In oneembodiment, software conventions are employed at software moduleboundaries, in order to permit the combination of separately compiledcode and to provide standard interfaces between application, library andsystem software. In one embodiment, instruction scheduling is performedby a compiler.

THE FIGURES

[0016]FIG. 1 is a system level diagram showing the functional blocks ofa system according to the present invention.

[0017]FIG. 2 is a matrix representation of a wide matrix multiply inaccordance with one embodiment of the present invention.

[0018]FIG. 3 is a further representation of a wide matrix multiple inaccordance with one embodiment of the present invention.

[0019]FIG. 4 is a system level diagram showing the functional blocks ofa system incorporating a combined Simultaneous Multi Threading andDecoupled Access from Execution processor in accordance with oneembodiment of the present invention.

[0020]FIG. 5 illustrates a wide operand in accordance with oneembodiment of the present invention.

[0021]FIG. 6 illustrates an approach to specifier decoding in accordancewith one embodiment of the present invention.

[0022]FIG. 7 illustrates in operational block form a Wide Function Unitin accordance with one embodiment of the present invention.

[0023]FIG. 8 illustrates in flow diagram form the Wide Microcachecontrol function.

[0024]FIG. 9 illustrates Wide Microcache data structures.

[0025]FIGS. 10 and 11 illustrate a Wide Microcache control.

[0026]FIG. 12 is a timing diagram of a decoupled pipeline structure inaccordance with one embodiment of the present invention.

[0027]FIG. 13 further illustrates the pipeline organization of FIG. 12.

[0028]FIG. 14 is a diagram illustrating the basic organization of thememory management system according to the present embodiment of theinvention.

[0029]FIG. 15 illustrates the physical address of an LTB entry forthread th, entry en, byte b.

[0030]FIG. 16 illustrates a definition for AccessPhysicalLTB.

[0031]FIG. 17 illustrates how various 16-bit values are packed togetherinto a 64-bit LTB entry.

[0032]FIG. 18 illustrates global access as fields of a control register.

[0033]FIG. 19 shows how a single-set LTB context may be furthersimplified by reserving the implementation of the lm and la registers.

[0034]FIG. 20 shows the partitioning of the virtual address space if thelargest possible space is reserved for an address space identifier.

[0035]FIG. 21 shows how the LTB protect field controls the minimumprivilege level required for each memory action of read (r), write (w),execute (x), and gateway (g), as well as memory and cache attributes ofwrite allocate (wa), detail access (da), strong ordering (so), cachedisable (cd), and write through (wt).

[0036]FIG. 22 illustrates a definition for LocalTranslation.

[0037]FIG. 23 shows how the low-order GT bits of the th value areignored, reflecting that 2GT threads share a single GTB.

[0038]FIG. 24 illustrates a definition for AccessPhysicalGTB.

[0039]FIG. 25 illustrates the format of a GTB entry.

[0040]FIG. 26 illustrates a definition for GlobalAddressTranslation.

[0041]FIG. 27 illustrates a definition for GTBUpdateWrite.

[0042]FIG. 28 shows how the low-order GT bits of the th value areignored, reflecting that 2GT threads share single GTB registers.

[0043]FIG. 29 illustrates the registers GTBLast, GTBFirst, and GTBBump.

[0044]FIG. 30 illustrates a definition for AccessPhysicalGTBRegisters.

[0045]FIGS. 31A-31C illustrate Group Boolean instructions in accordancewith an exemplary embodiment of the present invention.

[0046]FIGS. 31D-31E illustrate Group Multiplex instructions inaccordance with an exemplary embodiment of the present invention.

[0047]FIGS. 32A-32C illustrate Group Add instructions in accordance withan exemplary embodiment of the present invention.

[0048]FIGS. 33A-33C illustrate Group Subtract and Group Set instructionsin accordance with an exemplary embodiment of the present invention.

[0049]FIGS. 34A-34C illustrate Ensemble Divide and Ensemble Multiplyinstructions in accordance with an exemplary embodiment of the presentinvention.

[0050]FIGS. 35A-35C illustrate Group Compare instructions in accordancewith an exemplary embodiment of the present invention.

[0051]FIGS. 36A-36C illustrate Ensemble Unary instructions in accordancewith an exemplary embodiment of the present invention.

[0052]FIG. 37 illustrates exemplary functions that are defined for usewithin the detailed instruction definitions in other sections.

[0053]FIGS. 38A-38C illustrate Ensemble Floating-Point Add, EnsembleFloating-Point Divide, and Ensemble Floating-Point Multiply instructionsin accordance with an exemplary embodiment of the present invention.

[0054]FIGS. 38D-38F illustrate Ensemble Floating-Point Multiply Addinstructions in accordance with an exemplary embodiment of the presentinvention.

[0055]FIGS. 38G-38I illustrate Ensemble Floating-Point Scale Addinstructions in accordance with an exemplary embodiment of the presentinvention.

[0056]FIGS. 39A-39C illustrate Ensemble Floating-Point Subtractinstructions in accordance with an exemplary embodiment of the presentinvention.

[0057]FIGS. 39D-39G illustrate Group Set Floating-point instructions inaccordance with an exemplary embodiment of the present invention.

[0058]FIGS. 40A-40C illustrate Group Compare Floating-point instructionsin accordance with an exemplary embodiment of the present invention.

[0059]FIGS. 41A-41C illustrate Ensemble Unary Floating-pointinstructions in accordance with an exemplary embodiment of the presentinvention.

[0060]FIGS. 42A-42D illustrate Ensemble Multiply Galois Fieldinstructions in accordance with an exemplary embodiment of the presentinvention.

[0061]FIGS. 43A-43D illustrate Compress, Expand, Rotate, and Shiftinstructions in accordance with an exemplary embodiment of the presentinvention.

[0062]FIGS. 43E-43G illustrate Shift Merge instructions in accordancewith an exemplary embodiment of the present invention.

[0063]FIGS. 43H-43J illustrate Compress Immediate, Expand Immediate,Rotate Immediate, and Shift Immediate instructions in accordance with anexemplary embodiment of the present invention.

[0064]FIGS. 43K-43M illustrate Shift Merge Immediate instructions inaccordance with an exemplary embodiment of the present invention.

[0065]FIGS. 44A-44D illustrate Extract instructions in accordance withan exemplary embodiment of the present invention.

[0066]FIGS. 44E-44G illustrate Ensemble Extract instructions inaccordance with an exemplary embodiment of the present invention.

[0067]FIGS. 45A-45F illustrate Deposit and Withdraw instructions inaccordance with an exemplary embodiment of the present invention.

[0068]FIGS. 45G-45J illustrate Deposit Merge instructions in accordancewith an exemplary embodiment of the present invention.

[0069]FIGS. 46A-46E illustrate Shuffle instructions in accordance withan exemplary embodiment of the present invention.

[0070]FIGS. 47A-47C illustrate Swizzle instructions in accordance withan exemplary embodiment of the present invention.

[0071]FIGS. 47D-47E illustrate Select instructions in accordance with anexemplary embodiment of the present invention.

[0072]FIG. 48 is a pin summary describing the functions of various pinsin accordance with the one embodiment of the present invention.

[0073]FIGS. 49A-49G present electrical specifications describing AC andDC parameters in accordance with one embodiment of the presentinvention.

[0074]FIGS. 50A-50C illustrate Load instructions in accordance with anexemplary embodiment of the present invention.

[0075]FIGS. 51A-51C illustrate Load Immediate instructions in accordancewith an exemplary embodiment of the present invention.

[0076]FIGS. 52A-52C illustrate Store and Store Multiplex instructions inaccordance with an exemplary embodiment of the present invention.

[0077]FIGS. 53A-53C illustrate Store Immediate and Store MultiplexImmediate instructions in accordance with an exemplary embodiment of thepresent invention.

DETAILED DESCRIPTION OF THE INVENTION

[0078] Referring first to FIG. 1, a general purpose processor isillustrated therein in block diagram form. In FIG. 1, four copies of anaccess unit are shown, each with an access instruction fetch queueA-Queue 101-104. Each access instruction fetch queue A-Queue 101104 iscoupled to an access register file AR 105-108, which are each coupled totwo access functional units A 109-116. In a typical embodiment, eachthread of the processor may have on the order of sixty-four generalpurpose registers (e.g., the AR's 105-108 and ER's 125-128 ). The accessunits function independently for four simultaneous threads of execution,and each compute program control flow by performing arithmetic andbranch instructions and access memory by performing load and storeinstructions. These access units also provide wide operand specifiersfor wide operand instructions. These eight access functional units A109-116 produce results for access register files AR 105-108 and memoryaddresses to a shared memory system 117-120.

[0079] In one embodiment, the memory hierarchy includes on-chipinstruction and data memories, instruction and data caches, a virtualmemory facility, and interfaces to external devices. In FIG. 1, thememory system is comprised of a combined cache and niche memory 117, anexternal bus interface 118, and, externally to the device, a secondarycache 119 and main memory system with I/O devices 120. The memorycontents fetched from memory system 117-120 are combined with executeinstructions not performed by the access unit, and entered into the fourexecute instruction queues E-Queue 121-124. In accordance with oneembodiment of the present invention, from the software perspective, themachine state includes a linear byte-addressed shared memory space. Forwide instructions, memory contents fetched from memory system 117-120are also provided to wide operand microcaches 132-136 by bus 137.Instructions and memory data from E-queue 121-124 are presented toexecution register files 125-128, which fetch execution register filesource operands. The instructions are coupled to the execution unitarbitration unit Arbitration 131, that selects which instructions fromthe four threads are to be routed to the available execution functionalunits E 141 and 149, X 142 and 148, G 143-144 and 146-147, and T 145.The execution functional units E 141 and 149, the execution functionalunits X 142 and 148, and the execution functional unit T 145 eachcontain a wide operand microcache 132-136, which are each coupled to thememory system 117 by bus 137.

[0080] The execution functional units G 143-144 and 146-147 are grouparithmetic and logical units that perform simple arithmetic and logicalinstructions, including group operations wherein the source and resultoperands represent a group of values of a specified symbol size, whichare partitioned and operated on separately, with results catenatedtogether. In a presently preferred embodiment the data path is 128 bitswide, although the present invention is not intended to be limited toany specific size of data path.

[0081] The execution functional units X 142 and 148 are crossbar switchunits that perform crossbar switch instructions. The crossbar switchunits 142 and 148 perform data handling operations on the data streamprovided over the data path source operand buses 151-158, includingdeal, shuffles, shifts, expands, compresses, swizzles, permutes andreverses, plus the wide operations discussed hereinafter. In a keyelement of a first aspect of the invention, at least one such operationwill be expanded to a width greater than the general register and datapath width. Examples of the data manipulation operations are describedin the Appendix included herewith.

[0082] The execution functional units E 141 and 149 are ensemble unitsthat perform, ensemble instructions using a large array multiplier,including group or vector multiply and matrix multiply of operandspartitioned from data path source operand buses 151-158 and treated asinteger, floating-point, polynomial or Galois field values. According tothe present embodiment of the invention, a general software solution isprovided to the most common operations required for Galois Fieldarithmetic. The instructions provided include a polynomial multiply,with the polynomial specified as one register operand. This instructioncan be used to perform CRC generation and checking, Reed-Solomon codegeneration and checking, and spread-spectrum encoding and decoding.Also, matrix multiply instructions and other operations described in theAppendix included herewith utilize a wide operand loaded into the wideoperand microcache 132 and 136.

[0083] The execution functional unit T 145 is a translate unit thatperforms table-look-up operations on a group of operands partitionedfrom a register operand, and catenates the result. The Wide Translateinstruction described in the Appendix included herewith utilizes a wideoperand loaded into the wide operand microcache 134.

[0084] The execution functional units E 141, 149, execution functionalunits X −142, 148, and execution functional unit T each containdedicated storage to permit storage of source operands including wideoperands as discussed hereinafter. The dedicated storage 132-136, whichmay be thought of as a wide microcache, typically has a width which is amultiple of the width of the data path operands related to the data pathsource operand buses 151-158. Thus, if the width of the data path151-158 is 128 bits, the dedicated storage 132-136 may have a width of256, 512, 1024 or 2048 bits. Operands which utilize the full width ofthe dedicated storage are referred to herein as wide operands, althoughit is not necessary in all instances that a wide operand use theentirety of the width of the dedicated storage; it is sufficient thatthe wide operand use a portion greater than the width of the memory datapath of the output of the memory system 117-120 and the functional unitdata path of the input of the execution functional units 141-149, thoughnot necessarily greater than the width of the two combined. Because thewidth of the dedicated storage 132-136 is greater than the width of thememory operand bus 137, portions of wide operands are loadedsequentially into the dedicated storage 132-136. However, once loaded,the wide operands may then be used at substantially the same time. Itcan be seen that functional units 141-149 and associated executionregisters 125-128 form a data functional unit, the exact elements ofwhich may vary with implementation.

[0085] The execution register file ER 125-128 source operands arecoupled to the execution units 141-145 using source operand buses151-154 and to the execution units 145-149 using source operand buses155-158. The function unit result operands from execution units 141145are coupled to the execution register file ER 125-128 using result bus161 and the function units result operands from execution units 145-149are coupled to the execution register file using result bus 162.

[0086] The wide operands used in some embodiments of the presentinvention provide the ability to execute complex instructions such asthe wide multiply matrix instruction shown in FIG. 2, which can beappreciated in an alternative form, as well, from FIG. 3. As can beappreciated from FIGS. 2 and 3, a wide operand permits, for example, thematrix multiplication of various sizes and shapes which exceed the datapath width. The example of FIG. 2 involves a matrix specified byregister rc having a 128*64/size multiplied by a vector contained inregister rb having a 128 size, to yield a result, placed in register rd,of 128 bits.

[0087] The operands that are substantially larger than the data pathwidth of the processor are provided by using a general-purpose registerto specify a memory specifier from which more than one but in someembodiments several data path widths of data can be read into thededicated storage. The memory specifier typically includes the memoryaddress together with the size and shape of the matrix of data beingoperated on. The memory specifier or wide operand specifier can bebetter appreciated from FIG. 5, in which a specifier 500 is seen to bean address, plus a field representative of the size/2 and a furtherfield representative of width/2, where size is the product of the depthand width of the data. The address is aligned to a specified size, forexample sixty-four bytes, so that a plurality of low order bits (forexample, six bits) are zero. The specifier 500 can thus be seen tocomprise a first field 505 for the address, plus two field indicia 510within the low order six bits to indicate size and width.

[0088] The decoding of the specifier 500 may be further appreciated fromFIG. 6 where, for a given specifier 600 made up of an address field 605together with a field 610 comprising plurality of low order bits. By aseries of arithmetic operations shown at steps 615 and 620, the portionof the field 610 representative of width/2 is developed. In a similarseries of steps shown at 625 and 630, the value of t is decoded, whichcan then be used to decode both size and address. The portion of thefield 610 representative of size/2 is decoded as shown at steps 635 and640, while the address is decoded in a similar way at steps 645 and 650.

[0089] The wide function unit may be better appreciated from FIG. 7, inwhich a register number 700 is provided to an operand checker 705. Wideoperand, specifier 710 communicates with the operand checker 705 andalso addresses memory 715 having a defined memory width. The memoryaddress includes a plurality of register operands 720 A-n, which areaccumulated in a dedicated storage portion 714 of a data functional unit725. In the exemplary embodiment shown in FIG. 7, the dedicated storage714 can be seen to have a width equal to eight data path widths, suchthat eight wide operand portions 730 A-H are sequentially loaded intothe dedicated storage to form the wide operand. Although eight portionsare shown in FIG. 7, the present invention is not limited to eight orany other specific multiple of data path widths. Once the wide operandportions 730 A-H are sequentially loaded, they may be used as a singlewide operand 735 by the functional element 740, which may be anyelement(s) from FIG. 1 connected thereto. The result of the wide operandis then provided to a result register 745, which in a presentlypreferred embodiment is of the same width as the memory width.

[0090] Once the wide operand is successfully loaded into the dedicatedstorage 714, a second aspect of the present invention may beappreciated. Further execution of this instruction or other similarinstructions that specify the same memory address can read the dedicatedstorage to obtain the operand value under specific conditions thatdetermine whether the memory operand has been altered by interveninginstructions. Assuming that these conditions are met, the memory operandfetch from the dedicated storage is combined with one or more registeroperands in the functional unit, producing a result. In someembodiments, the size of the result is limited to that of a generalregister, so that no similar dedicated storage is required for theresult. However, in some different embodiments, the result may be a wideoperand, to further enhance performance.

[0091] To permit the wide operand value to be addressed by subsequentinstructions specifying the same memory address, various conditions mustbe checked and confirmed:

[0092] Those Conditions Include:

[0093] 1. Each memory store instruction checks the memory addressagainst the memory addresses recorded for the dedicated storage. Anymatch causes the storage to be marked invalid, since a memory storeinstruction directed to any of the memory addresses stored in dedicatedstorage 714 means that data has been overwritten.

[0094] 2. The register number used to address the storage is recorded.If no intervening instructions have written to the register, and thesame register is used on the subsequent instruction, the storage isvalid (unless marked invalid by rule #1).

[0095] 3. If the register has been modified or a different registernumber is used, the value of the register is read and compared againstthe address recorded for the dedicated storage. This uses more resourcesthan #1 because of the need to fetch the register contents and becausethe width of the register is greater than that of the register numberitself. If the address matches, the storage is valid. The new registernumber is recorded for the dedicated storage.

[0096] If conditions #2 or #3 are not met, the register contents areused to address the general-purpose processor's memory and load thededicated storage. If dedicated storage is already fully loaded, aportion of the dedicated storage must be discarded (victimized) to makeroom for the new value. The instruction is then performed using thenewly updated dedicated storage. The address and register number isrecorded for the dedicated storage.

[0097] By checking the above conditions, the need for saving andrestoring the dedicated storage is eliminated. In addition, if thecontext of the processor is changed and the new context does not employWide instructions that reference the same dedicated storage, when theoriginal context is restored, the contents of the dedicated storage areallowed to be used without refreshing the value from memory, usingchecking rule #3. Because the values in the dedicated storage are readfrom memory and not modified directly by performing wide operations, thevalues can be discarded at any time without saving the results intogeneral memory. This property simplifies the implementation of rule #4above.

[0098] An alternate embodiment of the present invention can replace rule#1 above with the following rule:

[0099] 1a. Each memory store ‘instruction checks the memory addressagainst the memory addresses recorded for the dedicated storage. Anymatch causes the dedicated storage to be updated, as well as the generalmemory.

[0100] By use of the above rule 1. a, memory store instructions canmodify the dedicated storage, updating just the piece of the dedicatedstorage that has been changed, leaving the remainder intact. Bycontinuing to update the general memory, it is still true that thecontents of the dedicated memory can be discarded at any time withoutsaving the results into general memory. Thus rule #4 is not made morecomplicated by this choice. The advantage of this alternate embodimentis that the dedicated storage need not be discarded (invalidated) bymemory store operations.

[0101] Referring next to FIG. 9, an exemplary arrangement of the datastructures of the wide microcache or dedicated storage 114 may be betterappreciated. The wide microcache contents, wmc.c, can be seen to form aplurality of data path widths 900 A-n, although in the example shown thenumber is eight. The physical address, wmc.pa, is shown as 64 bits inthe example shown, although the invention is not limited to a specificwidth. The size of the contents, wmc.size, is also provided in a fieldwhich is shown as 10 bits in an exemplary embodiment. A “contents valid”flag, wmc.ev, of one bit is also included in the data structure,together with a two bit field for thread last used, or wmc.th. Inaddition, a six bit field for register last used, wmc.reg, is providedin an exemplary embodiment. Further, a one bit flag for register andthread valid, or wmc.rtv, may be provided.

[0102] The process by which the microcache is initially written with awide operand, and thereafter verified as valid for fast subsequentoperations, may be better appreciated from FIG. 8. The process begins at800, and progresses to step 805 where a check of the register contentsis made against the stored value wmc.rc. If true, a check is made atstep 810 to verify the thread. If true, the process then advances tostep 815 to verify whether the register and thread are valid. If step815 reports as true, a check is made at step 820 to verify whether thecontents are valid. If all of steps 805 through 820 return as true, thesubsequent instruction is able to utilize the existing wide operand asshown at step 825, after which the process ends. However, if any ofsteps 805 through 820 return as false, the process branches to step 830,where content, physical address and size are set. Because steps 805through 820 all lead to either step 825 or 830, steps 805 through 820may be performed in any order or simultaneously without altering theprocess. The process then advances to step 835 where size is checked.This check basically ensures that the size of the translation unit isgreater than or equal to the size of the wide operand, so that aphysical address can directly replace the use of a virtual address. Theconcern is that, in some embodiments, the wide operands may be largerthan the minimum region that the virtual memory system is capable ofmapping. As a result, it would be possible for a single contiguousvirtual address range to be mapped into multiple, disjoint physicaladdress ranges, complicating the task of comparing physical addresses.By determining the size of the wide operand and comparing that sizeagainst the size of the virtual address mapping region which isreferenced, the instruction is aborted with an exception trap if thewide operand is larger than the mapping region. This ensures secureoperation of the processor. Software can then re-map the region using alarger size map to continue execution if desired. Thus, if size isreported as unacceptable at step 835, an exception is generated at step840. If size is acceptable, the process advances to step 845 wherephysical address is checked. If the check reports as met, the processadvances to step 850, where a check of the contents valid flag is made.If either check at step 845 or 850 reports as false, the processbranches and new content is written into the dedicated storage 114, withthe fields thereof being set accordingly. Whether the check at step 850reported true, or whether new content was written at step 855, theprocess advances to step 860 where appropriate fields are set toindicate the validity of the data, after which the requested functioncan be performed at step 825. The process then ends.

[0103] Referring next to FIGS. 10 and 11, which together show theoperation of the microcache controller from a hardware standpoint, theoperation of the microcache controller may be better understood. In thehardware implementation, it is clear that conditions which are indicatedas sequential steps in FIGS. 8 and 9 above can be performed in parallel,reducing the delay for such wide operand checking. Further, a copy ofthe indicated hardware may be included for each wide microcache, andthereby all such microcaches as may be alternatively referenced by aninstruction can be tested in parallel. It is believed that no furtherdiscussion of FIGS. 10 and 11 is required in view of the extensivediscussion of FIGS. 8 and 9, above.

[0104] Various alternatives to the foregoing approach do exist for theuse of wide operands, including an implementation in which a singleinstruction can accept two wide operands, partition the operands intosymbols, multiply corresponding symbols together, and add the productsto produce a single scalar value or a vector of partitioned values ofwidth of the register file, possibly after extraction of a portion ofthe sums. Such an instruction can be valuable for detection of motion orestimation of motion in video compression. A further enhancement of suchan instruction can incrementally update the dedicated storage if theaddress of one wide operand is within the range of previously specifiedwide operands in the dedicated storage, by loading only the portion notalready within the range and shifting the in-range portion as required.Such an enhancement allows the operation to be performed over a “slidingwindow” of possible values. In such an instruction, one wide operand isaligned and supplies the size and shape information, while the secondwide operand, updated incrementally, is not aligned.

[0105] Another alternative embodiment of the present invention candefine additional instructions where the result operand is a wideoperand. Such an enhancement removes the limit that a result can be nolarger than the size of a general register, further enhancingperformance. These wide results can be cached locally to the functionalunit that created them, but must be copied to the general memory systembefore the storage can be reused and before the virtual memory systemalters the mapping of the address of the wide result. Data paths must beadded so that load operations and other wide operations can read thesewide results—forwarding of a wide result from the output of a functionalunit back to its input is relatively easy, but additional data paths mayhave to be introduced if it is desired to forward wide results back toother functional units as wide operands.

[0106] As previously discussed, a specification of the size and shape ofthe memory operand is included in the low-order bits of the address. Ina presently preferred implementation, such memory operands are typicallya power of two in size and aligned to that size. Generally, one-half thetotal size is added (or inclusively or'ed, or exclusively or'ed) to thememory address, and one half of the data width is added (or inclusivelyor'ed, or exclusively or'ed) to the memory address. These bits can bedecoded and stripped from the memory address, so that the controller ismade to step through all the required addresses. This decreases thenumber of distinct operands required for these instructions, as thesize, shape and address of the memory operand are combined into a singleregister operand value.

[0107] Particular examples of wide operations which are defined by thepresent invention include the Wide Switch instruction that performsbit-level switching; the Wide Translate instruction which performs byte(or larger) table-lookup; Wide Multiply Matrix, Wide Multiply MatrixExtract and Wide Multiply Matrix Extract Immediate (discussed below),Wide Multiply Matrix Floating-point, and Wide Multiply Matrix Galois(also discussed below). While the discussion below focuses on particularsizes for the exemplary instructions, it will be appreciated that theinvention is not limited to a particular width.

[0108] The Wide Switch instruction rearranges the contents of up to tworegisters (256 bits) at the bit level, producing a full-width (128 bits)register result. To control the rearrangement, a wide operand specifiedby a single register, consisting of eight bits per bit position is used.For each result bit position, eight wide operand bits for each bitposition select which of the 256 possible source register bits to placein the result. When a wide operand size smaller than 128 bytes, the highorder bits of the memory operand are replaced with values correspondingto the result bit position, so that the memory operand specifies a bitselection within symbols of the operand size, performing the sameoperation on each symbol.

[0109] The Wide Translate instructions use a wide operand to specify atable of depth up to 256 entries and width of up to 128 bits. Thecontents of a register is partitioned into operands of one, two, four,or eight bytes, and the partitions are used to select values from thetable in parallel. The depth and width of the table can be selected byspecifying the size and shape of the wide operand as described above.

[0110] The Wide Multiply Matrix instructions use a wide operand tospecify a matrix of values of width up to 64 bits (one half of registerfile and data path width) and depth of up to 128 bits/symbol size. Thecontents of a general register (128 bits) is used as a source operand,partitioned into a vector of symbols, and multiplied with the matrix,producing a vector of width up to 128 bits of symbols of twice the sizeof the source operand symbols. The width and depth of the matrix can beselected by specifying the size and shape of the wide operand asdescribed above. Controls within the instruction allow specification ofsigned, mixed-signed, unsigned, complex, or polynomial operands.

[0111] The Wide Multiply Matrix Extract instructions use a wide operandto specify a matrix of value of width up to 128 bits (full width ofregister file and data path) and depth of up to 128 bits/symbol size.The contents of a general register (128 bits) is used as a sourceoperand, partitioned into a vector of symbols, and multiplied with thematrix, producing a vector of width up to 256 bits of symbols of twicethe size of the source operand symbols plus additional bits to representthe sums of products without overflow. The results are then extracted ina manner described below (Enhanced Multiply Bandwidth by ResultExtraction), as controlled by the contents of a general registerspecified by the instruction. The general register also specifies theformat of the operands: signed, mixed-signed, unsigned, and complex aswell as the size of the operands, byte (8 bit), doublet (16 bit),quadlet (32 bit), or hexlet (64 bit).

[0112] The Wide Multiply Matrix Extract Immediate instructions performthe same function as above, except that the extraction, operand formatand size is controlled by fields in the instruction. This form encodescommon forms of the above instruction without the need to initialize aregister with the required control information. Controls within theinstruction allow specification of signed, mixed-signed, unsigned, andcomplex operands.

[0113] The Wide Multiply Matrix Floating-point instructions perform amatrix multiply in the same form as above, except that the multipliesand additions are performed in floating-point arithmetic. Sizes of half(16-bit), single (32-bit), double (64-bit), and complex sizes of half,single and double can be specified within the instruction.

[0114] Wide Multiply Matrix Galois instructions perform a matrixmultiply in the same form as above, except that the multiples andadditions are performed in Galois field arithmetic. A size of 8 bits canbe specified within the instruction. The contents of a general registerspecify the polynomial with which to perform the Galois field remainderoperation. The nature of the matrix multiplication is novel anddescribed in detail below.

[0115] In another aspect of the invention, memory operands of eitherlittle-endian or big-endian conventional byte ordering are facilitated.Consequently, all Wide operand instructions are specified in two forms,one for little-endian byte ordering and one for big-endian byteordering, as specified by a portion of the instruction. The byte orderspecifies to the memory system the order in which to deliver the byteswithin units of the data path width (128 bits), as well as the order toplace multiple memory words (128 bits) within a larger Wide operand.Each of these instructions is described in greater detail in theAppendix filed herewith.

[0116] Some embodiments of the present invention address extraction of ahigh order portion of a multiplier product or sum of products, as a wayof efficiently utilizing a large multiplier array. Parent U.S. Pat. No.5,742,840 and U.S. Pat. No. 5,953,241 describe a system and method forenhancing the utilization of a multiplier array by adding specificclasses of instructions to a general-purpose processor. This addressesthe problem of making the most use of a large multiplier array that isfully used for high-precision arithmetic—for example a 64×64 bitmultiplier is fully used by a 64-bit by 64-bit multiply, but only onequarter used for a 32-bit by 32-bit multiply) for (relative to themultiplier data width and registers) low-precision arithmeticoperations. In particular, operations that perform a great manylow-precision multiplies which are combined (added) together in variousways are specified. One of the overriding considerations in selectingthe set of operations is a limitation on the size of the result operand.In an exemplary embodiment, for example, this size might be limited toon the order of 128 bits, or a single register, although no specificsize limitation need exist.

[0117] The size of a multiply result, a product, is generally the sum ofthe sizes of the operands, multiplicands and multiplier. Consequently,multiply instructions specify operations in which the size of the resultis twice the size of identically-sized input operands. For our prior artdesign, for example, a multiply instruction accepted two 64-bit registersources and produces a single 128-bit register-pair result, using anentire 64×64 multiplier array for 64-bit symbols, or half the multiplierarray for pairs of 32-bit symbols, or one-quarter the multiplier arrayfor quads of 16-bit symbols. For all of these cases, note that tworegister sources of 64 bits are combined, yielding a 128-bit result.

[0118] In several of the operations, including complex multiplies,convolve, and matrix multiplication, low-precision multiplier productsare added together. The additions further increase the requiredprecision. The sum of two products requires one additional bit ofprecision; adding four products requires two, adding eight productsrequires three, adding sixteen products requires four. In some priordesigns, some of this precision is lost, requiring scaling of themultiplier operands to avoid overflow, further reducing accuracy of theresult.

[0119] The use of register pairs creates an undesirable complexity, inthat both the register pair and individual register values must bebypassed to subsequent instructions. As a result, with prior arttechniques only half of the source operand 128-bit register values couldbe employed toward producing a single-register 128-bit result.

[0120] In some embodiments of the present invention, a high-orderportion of the multiplier product or sum of products is extracted,adjusted by a dynamic shift amount from a general register or anadjustment specified as part of the instruction, and, rounded by acontrol value from a register or instruction portion asround-to-nearest/even, toward zero, floor, or ceiling. Overflows arehandled by limiting the result to the largest and smallest values thatcan be accurately represented in the output result. This operation ismore fully described in the attached Appendix.

[0121] In the present invention, when the extract is controlled by aregister, the size of the result can be specified, allowing rounding andlimiting to a smaller number of bits than can fit in the result. Thispermits the result to be scaled to be used in subsequent operationswithout concern of overflow or rounding, enhancing performance.

[0122] Also in the present invention, when the extract is controlled bya register, a single register value defines the size of the operands,the shift amount and size of the result, and the rounding control. Byplacing all this control information in a single register, the size ofthe instruction is reduced over the number of bits that such ainstruction would otherwise require, improving performance and enhancingflexibility of the processor.

[0123] The particular instructions included in this aspect of thepresent invention are Ensemble Convolve Extract, Ensemble MultiplyExtract, Ensemble Multiply Add Extract and Ensemble Scale Add Extract,each of which is more thoroughly treated in the appendix.

[0124] An aspect of the present invention defines the Ensemble Scale AddExtract instruction, that combines the extract control information in aregister along with two values that are used as scalar multipliers tothe contents of two vector multiplicands. This combination reduces thenumber of registers that would otherwise be required, or the number ofbits that the instruction would otherwise require, improvingperformance.

[0125] Several of these instructions (Ensemble Convolve Extract,Ensemble Multiply Add Extract) are typically available only in formswhere the extract is specified as part of the instruction. Analternative embodiment can incorporate forms of the operations in whichthe size of the operand, the shift amount and the rounding can becontrolled by the contents of a general register (as they are in theEnsemble Multiply Extract instruction). The definition of this kind ofinstruction for Ensemble Convolve Extract, and Ensemble Multiply AddExtract would require four source registers, which increases complexityby requiring additional general-register read ports.

[0126] Another alternative embodiment can reduce the number of registerread-ports required for implementation of instructions in which thesize, shift and rounding of operands is controlled by a register. Thevalue of the extract control register can be fetched using an additionalcycle on an initial execution and retained within or near the functionalunit for subsequent executions, thus reducing the amount of hardwarerequired for implementation with a small additional performance penalty.The value retained would be marked invalid, causing a re-fetch of theextract control register, by instructions that modify the register, oralternatively, the retained value can be updated by such an operation. Are-fetch of the extract control register would also be required if adifferent register number were specified on a subsequent execution. Itshould be clear that the properties of the above two alternativeembodiments can be combined.

[0127] Another embodiment of the invention includes Galois fieldarithmetic, where multiplies are performed by an initial binarypolynomial multiplication (unsigned binary multiplication with carriessuppressed), followed by a polynomial modulo/remainder operation(unsigned binary division with carries suppressed). The remainderoperation is relatively expensive in area and delay. In Galois fieldarithmetic, additions are performed by binary addition with carriessuppressed, or equivalently, a bitwise exclusive-or operation. In thisaspect of the present invention, a matrix multiplication is performedusing Galois field arithmetic, where the multiplies and additions areGalois field multiples and additions.

[0128] Using prior art methods, a 16 byte vector multiplied by a 16×16byte matrix can be performed as 256 8-bit Galois field multiplies and16*15=240 8-bit Galois field additions. Included in the 256 Galois fieldmultiplies are 256 polynomial multiplies and 256 polynomial remainderoperations. But by use of the present invention, the total computationcan be reduced significantly by performing 256 polynomial multiplies,240 16-bit polynomial additions, and 16 polynomial remainder operations.Note that the cost of the polynomial additions has been doubled, asthese are now 16-bit operations, but the cost of the polynomialremainder functions has been reduced by a factor of 16. Overall, this isa favorable tradeoff, as the cost of addition is much lower than thecost of remainder.

[0129] In a still further aspect of the present invention, a techniqueis provided for incorporating floating point information into processorinstructions. In U.S. Pat. No. 5,812,439, a system and method aredescribed for incorporating control of rounding and exceptions forfloating-point instructions into the instruction itself. The presentinvention extends this invention to include separate instructions inwhich rounding is specified, but default handling of exceptions is alsospecified, for a particular class of floating-point instructions.Specifically, the SINK instruction (which converts floating-point valuesto integral values) is available with control in the instruction thatinclude all previously specified combinations (default-near rounding anddefault exceptions, Z—round-toward-zero and trap on exceptions, N—roundto nearest and trap on exceptions, F—floor rounding (toward minusinfinity) and trap on exceptions, C—ceiling rounding (toward plusinfinity) and trap on exceptions, and X—trap on inexact and otherexceptions), as well as three new combinations (Z.D—round toward zeroand default exception handling, F.D—floor rounding and default exceptionhandling, and C.D—ceiling rounding and default exception handling). (Theother combinations: N.D is equivalent to the default, and X.D—trap oninexact but default handling for other exceptions is possible but notparticularly valuable).

[0130] Pipelining and Multithreading

[0131] As shown in FIG. 4, some embodiments of the present inventionemploy both decoupled access from execution pipelines and simultaneousmultithreading in a unique way. Simultaneous Multithreaded pipelineshave been employed in prior art to enhance the utilization of data pathunits by allowing instructions to be issued from one of severalexecution threads to each functional unit (e.g., Susan Eggers,University of Wash, papers on Simultaneous Multithreading).

[0132] Decoupled access from execution pipelines have been employed inprior art to enhance the utilization of execution data path units bybuffering results from an access unit, which computes addresses to amemory unit that in turn fetches the requested items from memory, andthen presenting them to an execution unit (e.g., James E. Smith, paperon Decoupled Access from Execution).

[0133] Compared to conventional pipelines, Eggers prior art used anadditional pipeline cycle before instructions could be issued tofunctional units, the additional cycle needed to determine which threadsshould be permitted to issue instructions. Consequently, relative toconventional pipelines, the prior art design had additional delay,including dependent branch delay.

[0134] The embodiment shown in FIG. 4 contains individual access datapath units, with associated register files, for each execution thread.These access units produce addresses, which are aggregated together to acommon memory unit, which fetches all the addresses and places thememory contents in one or more buffers. Instructions for executionunits, which are shared to varying degrees among the threads are alsobuffered for later execution. The execution units then performoperations from all active threads using functional data path units thatare shared.

[0135] For instructions performed by the execution units, the extracycle required for prior art simultaneous multithreading designs isoverlapped with the memory data access time from prior art decoupledaccess from execution cycles, so that no additional delay is incurred bythe execution functional units for scheduling resources. Forinstructions performed by the access units, by employing individualaccess units for each thread the additional cycle for scheduling sharedresources is also eliminated.

[0136] This is a favorable tradeoff because, while threads do not sharethe access functional units, these units are relatively small comparedto the execution functional units, which are shared by threads.

[0137]FIG. 12 is a timing diagram of a decoupled pipeline structure inaccordance with one embodiment of the present invention. As illustratedin FIG. 12, the time permitted by a pipeline to service load operationsmay be flexibly extended. Here, various types of instructions areabbreviated as A, L, B, E, and S, representing a register-to-registeraddress calculation, a memory load, a branch, a register-to-registerdata calculation, and a memory store, respectively. According to thepresent embodiment, the front of the pipeline, in which A, L and B typeinstructions are handled, is decoupled from the back of the pipeline, inwhich E, and S type instructions are handled. This decoupling occurs atthe point at which the data cache and its backing memory is referenced;similarly, a FIFO that is filled by the instruction fetch unit decouplesinstruction cache references from the front of the pipeline shown above.The depth of the FIFO structures is implementation-dependent, i.e. notfixed by the architecture. FIG. 13 further illustrates this pipelineorganization. Accordingly, the latency of load instructions can behidden, as execute instructions are deferred until the results of theload are available. Nevertheless, the execution unit still processesinstructions in normal order, and provides precise exceptions. Moredetails relating to this pipeline structure is explained in the“Superspring Pipeline” section of the Appendix.

[0138] A difficulty in particular pipeline structures is that dependentoperations must be separated by the latency of the pipeline, and forhighly pipelined machines, the latency of simple operations can be quitesignificant. According to one embodiment of the present invention, veryhighly pipelined implementations are provided by alternating executionof two or more independent threads. In an embodiment, a thread is thestate required to maintain an independent execution; the architecturalstate required is that of the register file contents, program counter,privilege level, local TB, and when required, exception status. In anembodiment, ensuring that only one thread may handle an exception at onetime may minimize the latter state, exception status. In order to ensurethat all threads make reasonable forward progress, several of themachine resources must be scheduled fairly.

[0139] An example of a resource that is critical that it be fairlyshared is the data memory/cache subsystem. In one embodiment, theprocessor may be able to perform a load operation only on every secondcycle, and a store operation only on every fourth cycle. The processorschedules these fixed timing resources fairly by using a round-robinschedule for a number of threads that is relatively prime to theresource reuse rates. In one embodiment, five simultaneous threads ofexecution ensure that resources which may be used every two or fourcycles are fairly shared by allowing the instructions which use thoseresources to be issued only on every second or fourth issue slot forthat thread. More details relating to this pipeline structure areexplained in the “Superthread Pipeline” section of the Appendix.

[0140] Referring back to FIG. 4, with regard to the sharing of executionunits, one embodiment of the present invention employs several differentclassics of functional units for the execution unit, with varying cost,utilization, and performance. In particular, the G units, which performsimple addition and bitwise operations is relatively inexpensive (inarea and power) compared to the other units, and its utilization isrelatively high. Consequently, the design employs four such units, whereeach unit can be shared between two threads. The X unit, which performsa broad class of data switching functions is more expensive and lessused, so two units are provided that are each shared among two threads.The T unit, which performs the Wide Translate instruction, is expensiveand utilization is low, so the single unit is shared among all fourthreads. The E unit, which performs the class of Ensemble instructions,is very expensive in area and power compared to the other functionalunits, but utilization is relatively high, so we provide two such units,each unit shared by two threads.

[0141] In FIG. 4, four copies of an access unit are shown, each with anaccess instruction fetch queue A-Queue 401-404, coupled to an accessregister file AR 405-408, each of which is, in turn, coupled to twoaccess functional units A 409-416. The access units functionindependently for four simultaneous threads of execution. These eightaccess functional units A 409-416 produce results for access registerfiles AR 405-408 and addresses to a shared memory system 417. The memorycontents fetched from memory system 417 are combined with executeinstructions not performed by the access unit and entered into the fourexecute instruction queues E-Queue 421-424. Instructions and memory datafrom E-queue 421-424 are presented to execution register files 425-428,which fetches execution register file source operands. The instructionsare coupled to the execution unit arbitration unit Arbitration 431, thatselects which instructions from the four threads are to be routed to theavailable execution units E 441 and 449, X 442 and 448, G 443-444 and446-447, and T 445. The execution register file source operands ER425-428 are coupled to the execution units 441-445 using source operandbuses 451-454 and to the execution units 445-449 using source operandbuses 455-458. The function unit result operands from execution units441-445 are coupled to the execution register file using result bus 461and the function units result operands from execution units 445-449 arecoupled to the execution register file using result bus 462.

[0142] The foregoing elements of the present invention may be betterunderstood with reference to the attached Appendix.

[0143] In a still further aspect of the present invention, an improvedinterprivilege gateway is described which involves increased parallelismand leads to enhanced performance. In U.S. application Ser. No.08/541,416, now U.S. Pat. No. 6,101,590, a system and method isdescribed for implementing an instruction that, in a controlled fashion,allows the transfer of control (branch) from a lower-privilege level toa higher-privilege level. Embodiment of the present invention providesan improved system and method for a modified instruction thataccomplishes the same purpose but with specific advantages.

[0144] Many processor resources, such as control of the virtual memorysystem itself, input and output operations, and system control functionsare protected from accidental or malicious misuse by enclosing them in aprotective, privileged region. Entry to this region must be establishedonly though particular entry points, called gateways, to maintain theintegrity of these protected regions.

[0145] Prior art versions of this operation generally load an addressfrom a region of memory using a protected virtual memory attribute thatis only set for data regions that contain valid gateway entry points,then perform a branch to an address contained in the contents of memory.Basically, three steps were involved: load, branch, then check. Comparedto other instructions, such as register-to-register computationinstructions and memory loads and stores, and register-based branches,this is a substantially longer operation, which introduces delays andcomplexity to a pipelined implementation.

[0146] In the present invention, the branch-gateway instruction performstwo operations in parallel: 1) a branch is performed to the contents ofregister 0 and 2) a load is performed using the contents of register 1,using a specified byte order (little-endian) and a specified size (64bits). If the value loaded from memory does not equal the contents ofregister 0, the instruction is aborted due to an exception. In addition,3) a return address (the next sequential instruction address followingthe branch-gateway instruction) is written into register 0, provided theinstruction is not aborted. This approach essentially uses a firstinstruction to establish the requisite permission to allow user code toaccess privileged code, and then a second instruction is permitted tobranch directly to the privileged code because of the permissions issuedfor the first instruction.

[0147] In the present invention, the new privilege level is alsocontained in register 0, and the second parallel operation does not needto be performed if the new privilege level is not greater than the oldprivilege level. When this second operation is suppressed, the remainderof the instruction performs an identical function to a branch-linkinstruction, which is used for invoking procedures that do not requirean increase in privilege. The advantage that this feature brings is thatthe branch-gateway instruction can be used to call a procedure that mayor may not require an increase in privilege.

[0148] The memory load operation verifies with the virtual memory systemthat the region that is loaded has been tagged as containing validgateway data. A further advantage of the present invention is that thecalled procedure may rely on the fact that register 1 contains theaddress that the gateway data was loaded from, and can use the contentsof register 1 to locate additional data or addresses that the proceduremay require. Prior art versions of this instruction required that anadditional address be loaded from the gateway region of memory in orderto initialize that address in a protected manner-the present inventionallows the address itself to be loaded with a “normal” load operationthat does not require special protection.

[0149] The present invention allows a “normal” load operation to alsoload the contents of register 0 prior to issuing the branch-gatewayinstruction. The value may be loaded from the same memory address thatis loaded by the branch-gateway instruction, because the presentinvention contains a virtual memory system in which the region may beenabled for normal load operations as well as the special “gateway” loadoperation performed by the branch-gateway instruction.

[0150] In a further aspect of the present invention, a system and methodis provided for performing a three-input bitwise Boolean operation in asingle instruction. A novel method described in detail in appendix isused to encode the eight possible output states of such an operationinto only seven bits, and decoding these seven bits back into the eightstates.

[0151] In yet a further aspect to the present invention, a system andmethod is described for improving the branch prediction of simplerepetitive loops of code. The method includes providing a count fieldfor indicating how many times a branch is likely to be taken before itis not taken, which enhances the ability to properly predict both theinitial and final branches of simple loops when a compiler can determinethe number of iterations that the loop will be performed. This improvesperformance by avoiding misprediction of the branch at the end of aloop.

[0152] Memory Management

[0153] This section discusses the caches, the translation mechanisms,the memory interfaces, and how the multiprocessor interface is used tomaintain cache coherence.

[0154] a. Overview

[0155]FIG. 14 is a diagram illustrating the basic organization of thememory management system according to one embodiment of the invention.In accordance with this embodiment, the processor provides for bothlocal and global virtual addressing, arbitrary page sizes, andcoherent-cache multiprocessing. The memory management system is designedto provide the requirements for implementation of virtual machines aswell as virtual memory. All facilities of the memory management systemare themselves memory mapped, in order to provide for the manipulationof these facilities by high-level language, compiled code. Thetranslation mechanism is designed to allow full byte-at-a-time controlof access to the virtual address space, with the assistance of fastexception handlers. Privilege levels provide for the secure transitionbetween insecure user code and secure system facilities. Instructionsexecute at a privilege, specified by a two-bit field in the accessinformation. Zero is the least-privileged level, and three is themost-privileged level.

[0156] In general terms, the memory management starts from a localvirtual address. The local virtual address is translated to a globalvirtual address by an LTB (Local Translation Buffer). In turn, theglobal virtual address is translated to a physical address by a GTB(Global Translation Buffer). One of the addresses, a local virtualaddress, a global virtual address, or a physical address, is used toindex the cache data and cache tag arrays, and one of the addresses isused to check the cache tag array for cache presence. Protectioninformation is assembled from the LTB, GTB, and optionally the cachetag, to determine if the access is legal.

[0157] This form varies somewhat, depending on implementation choicesmade. Because the LTB leaves the lower 48 bits of the address alone,indexing of the cache arrays with the local virtual address is usuallyidentical to cache arrays indexed by the global virtual address.However, indexing cache arrays by the global virtual address rather thanthe physical address produces a coherence issue if the mapping fromglobal virtual address to physical is many-to-one.

[0158] Starting from a local virtual address, the memory managementsystem performs three actions in parallel: the low-order bits of thevirtual address are used to directly access the data in the cache, alow-order bit field is used to access the cache tag, and the high-orderbits of the virtual address are translated from a local address space toa global virtual address space.

[0159] Following these three actions, operations vary depending upon thecache implementation. The cache tag may contain either a physicaladdress and access control information (a physically-tagged cache), ormay contain a global virtual address and global protection information(a virtually-tagged cache).

[0160] For a physically-tagged cache, the global virtual address istranslated to a physical address by the GTB, which generates globalprotection information. The cache tag is checked against the physicaladdress, to determine a cache hit. In parallel, the local and globalprotection information is checked.

[0161] For a virtually-tagged cache, the cache tag is checked againstthe global virtual address, to determine a cache hit, and the local andglobal protection information is checked. If the cache misses, theglobal virtual address is translated to a physical address by the GTB,which also generates the global protection information.

[0162] b. Local Translation Buffer

[0163] The 64-bit global virtual address space is global among alltasks. In a multitask environment, requirements for a task-local addressspace arise from operations such as the UNIX “fork” function, in which atask is duplicated into parent and child tasks, each now having a uniquevirtual address space. In addition, when switching tasks, access to onetask's address space must be disabled and another task's access enabled.

[0164] The processor provides for portions of the address space to bemade local to individual tasks, with a translation to the global virtualspace specified by four 16-bit registers for each local virtual space.The registers specify a mask selecting which of the high-order 16address bits are checked to match a particular value, and if they match,a value with which to modify the virtual address. The processor avoidssetting a fixed page size or local address size; these can be set bysoftware conventions.

[0165] A local virtual address space is specified by the following:local virtual address space specifiers field name size description lm 16mask to select fields of local virtual address to perform match over la16 value to perform match with masked local virtual address lx 16 valueto xor with local virtual address if matched lp 16 local protectionfield (detailed later)

[0166] There are as many LTB as threads, and up to 23 (8) entries perLTB. Each entry is 128 bits, with the high order 64 bits reserved. FIG.15 illustrates the physical address of an LTB entry for thread th, entryen, byte b.

[0167]FIG. 16 illustrates a definition for AccessPhysicalLTB. FIG. 17illustrates how various 16-bit values are packed together into a 64-bitLTB entry. The LTB contains a separate context of register sets for eachthread, indicated by the th index above. A context consists of one ormore sets of lm/la/lx/lp registers, one set for each simultaneouslyaccessible local virtual address range, indicated by the en index above.This set of registers is called the “Local TB context,” or LTB (LocalTranslation Buffer) context. The effect of this mechanism is to providethe facilities normally attributed to segmentation. However, in thissystem there is no extension of the address range, instead, segments arelocal nicknames for portions of the global virtual address space.

[0168] A failure to match an LTB entry results either in an exception oran access to the global virtual address space, depending on privilegelevel. A single bit, selected by the privilege level active for theaccess from a four bit control register field, global access, gadetermines the result. If gaPL is zero (0), the failure causes anexception, if it is one (1), the failure causes the address to bedirectly used as a global virtual address without modification.

[0169]FIG. 18 illustrates global access as fields of a control register.Usually, global access is a right conferred to highly privilege levels,so a typical system may be configured with ga0 and ga1 clear (0), butga2 and ga3 set (1). A single low-privilege (0) task can be safelypermitted to have global access, as accesses are further limited by therwxg privilege fields. A concrete example of this is an emulation task,which may use global addresses to simulate segmentation, such as an ×86emulation. The emulation task then runs as privilege 0, with ga0 set,while most user tasks run as privilege 1, with ga1 clear. Operatingsystem tasks then use privilege 2 and 3 to communicate with and controlthe user tasks, with ga2 and ga3 set.

[0170] For tasks that have global access disabled at their currentprivilege level, failure to match an LTB entry causes an exception. Theexception handler may load an LTB entry and continue execution, thusproviding access to an arbitrary number of local virtual address ranges.

[0171] When failure to match an LTB entry does not cause an exception,instructions may access any region in the local virtual address space,when an LTB entry matches, and may access regions in the global virtualaddress space when no LTB entry matches. This mechanism permitsprivileged code to make judicious use of local virtual address ranges,which simplifies the manner in which privileged code may manipulate thecontents of a local virtual address range on behalf of a less-privilegedclient. Note, however, that under this model, an LTB miss does not causean exception directly, so the use of more local virtual address rangesthan LTB entries requires more care: the local virtual address rangesshould be selected so as not to overlap with the global virtual addressranges, and GTB misses to LVA regions must be detected and cause thehandler to load an LTB entry.

[0172] Each thread has an independent LTB, so that threads mayindependently define local translation. The size of the LTB for eachthread is implementation dependent and defined as the LE parameter inthe architecture description register. LE is the log of the number ofentries in the local TB per thread; an implementation may define LE tobe a minimum of 0, meaning one LTB entry per thread, or a maximum of 3,meaning eight LTB entries per thread. For the initial Zeusimplementation, each thread has two entries and LE=1.

[0173] A minimum implementation of an LTB context is a single set oflm/la/lx/lp registers per thread. However, the need for the LTB totranslate both code addresses and data addresses imposes some limits onthe use of the LTB in such systems. We need to be able to guaranteeforward progress. With a single LTB set per thread, either the code orthe data must use global addresses, or both must use the same localaddress range, as must the LTB and GTB exception handler. To avoid thisrestriction, the implementation must be raised to two sets per thread,at least one for code and one for data, to guarantee forward progressfor arbitrary use of local addresses in the user code (but still belimited to using global addresses for exception handlers).

[0174] As shown in FIG. 19, a single-set LTB context may be furthersimplified by reserving the implementation of the lm and la registers,setting them to a read-only zero value: Note that in such aconfiguration, only a single LA region can be implemented.

[0175] If the largest possible space is reserved for an address spaceidentifier, the virtual address is partitioned as shown in FIG. 20. Anyof the bits marked as “local” below may be used as “offset” as desired.

[0176] To improve performance, an implementation may perform the LTBtranslation on the value of the base register (rc) or unincrementedprogram counter, provided that a check is performed which prohibitschanging the unmasked upper 16 bits by the add or increment. If thisoptimization is provided and the check fails, anAccessDisallowedByVirtualAddress should be signaled. If thisoptimization is provided, the architecture description parameter LB=1.Otherwise LTB translation is performed on the local address, la, nochecking is required, and LB=0.

[0177] As shown in FIG. 21, the LTB protect field controls the minimumprivilege level required for each memory action of read (r), write (w),execute (x), and gateway (g), as well as memory and cache attributes ofwrite allocate (wa), detail access (da), strong ordering (so), cachedisable (cd), and write through (wt). These fields are combined withcorresponding bits in the GTB protect field to control these attributesfor the mapped memory region.

[0178] The meaning of the fields are given by the following table: namesize meaning g 2 minimum privilege required for gateway access x 2minimum privilege required for execute access w 2 minimum privilegerequired for write access r 2 minimum privilege required for read access0 1 reserved da 1 detail access so 1 strong ordering cc 3 cache control

[0179]FIG. 22 illustrates a definition for LocalTranslation.

[0180] c. Global Translation Buffer

[0181] Global virtual addresses which fail to be accessed in either theLZC, the MTB, the BTB, or PTB are translated to physical references in atable, here named the “Global Translation Buffer,” (GTB).

[0182] Each processor may have one or more GTB's, with each GTB sharedby one or more threads. The parameter GT, the base-two log of the numberof threads which share a GTB, and the parameter T, the number ofthreads, allow computation of the number of GTBs (T/2GT), and the numberof threads which share each GTB (2GT).

[0183] If there are two GTBs and four threads (GT=1, T=4), GTB 0services references from threads 0 and 1, and GTB 1 services referencesfrom threads 2 and 3. In the first implementation, there is one GTB,shared by all four threads. (GT=2, =4).The GTB has 128 entries (G=7).

[0184] Per clock cycle, each GTB can translate one global virtualaddress to a physical address, yielding protection information as a sideeffect.

[0185] A GTB miss causes a software trap. This trap is designed topermit a fast handler for GlobalTBMiss to be written in software, bypermitting a second GTB miss to occur as an exception, rather than amachine check.

[0186] There may be as many GTB as threads, and up to 215 entries perGTB. FIG. 23 illustrates the physical address of a GTB entry for threadth, entry en, byte b. Note that in FIG. 23, the low-order GT bits of theth value are ignored, reflecting that 2GT threads share a single GTB. Asingle GTB shared between threads appears multiple times in the addressspace. GTB entries are packed together so that entries in a GTB areconsecutive:

[0187]FIG. 24 illustrates a definition for AccessPhysicalGTB. FIG. 25illustrates the format of a GTB entry. As shown, each GTB entry is 128bits.gs=ga+size/2: 256≦size≦264, ga, global address, is aligned (amultiple of) size. px=pa{circumflex over ( )}ga. pa, ga, and px are allaligned (a multiple of) size.

[0188] The meaning of the fields are given by the following table: namesize meaning gs 57 global address with size px 56 physical xor g 2minimum privilege required for gateway access x 2 minimum privilegerequired for execute access w 2 minimum privilege required for writeaccess r 2 minimum privilege required for read access 0 1 reserved da 1detail access so 1 strong ordering cc 3 cache control

[0189] If the entire contents of the GTB entry is zero (0), the entrywill not match any global address at all. If a zero value is written, azero value is read for the GTB entry. Software must not write a zerovalue for the gs field unless the entire entry is a zero value.

[0190] It is an error to write GTB entries that multiply match anyglobal address; all GTB entries must have unique, non-overlappingcoverage of the global address space. Hardware may produce a machinecheck if such overlapping coverage is detected, or may produce anyphysical address and protection information and continue execution.

[0191] Limiting the GTB entry size to 128 bits allows up to replaceentries atomically (with a single store operation), which is lesscomplex than the previous design, in which the mask portion was firstreduced, then other entries changed, then the mask is expanded. However,it is limiting the amount of attribute information or physical addressrange we can specify. Consequently, we are encoding the size as a singleadditional bit to the global address in order to allow for attributeinformation. FIG. 26 illustrates a definition forGlobalAddressTranslation.

[0192] d. GTB Registers

[0193] Because the processor contains multiple threads of execution,even when taking virtual memory exceptions, it is possible for twothreads to nearly simultaneously invoke software GTB miss exceptionhandlers for the same memory region. In order to avoid producingimproper GTB state in such cases, the GTB includes access facilities forindivisibly checking and then updating the contents of the GTB as aresult of a memory write to specific addresses.

[0194] A 128-bit write to the address GTBUpdateFill (fill=1), as a sideeffect, causes first a check of the global address specified in the dataagainst the GTB. If the global address check results in a match, thedata is directed to write on the matching entry. If there is no match,the address specified by GTBLast is used, and GTBLast is incremented. Ifincrementing GTBLast results in a zero value, GTBLast is reset toGTBFirst, and GTBBump is set. Note that if the size of the updated valueis not equal to the size of the matching entry, the global address checkmay not adequately ensure that no other entries also cover the addressrange of the updated value. The operation is unpredictable if multipleentries match the global address.

[0195] The GTBUpdateFill register is a 128-bit memory-mapped location,to which a write operation performs the operation defined above. A readoperation returns a zero value. The format of the GTBUpdateFill registeris identical to that of a GTB entry.

[0196] An alternative write address, GTBUpdate, (fill=0) updates amatching entry, but makes no change to the GTB if no entry matches. Thisoperation can be used to indivisibly update a GTB entry as to protectionor physical address information. FIG. 27 illustrates a definition forGTBUpdateWrite.

[0197] There may be as many GTB as threads, and up to 211 registers perGTB (5 registers are implemented). FIG. 28 illustrates the physicaladdress of a GTB control register for thread th, register m, byte b.Note that in FIG. 28, the low-order GT bits of the th value are ignored,reflecting that 2GT threads share single GTB registers. A single set ofGTB registers shared between threads appears multiple times in theaddress space, and manipulates the GTB of the threads with which theregisters are associated.

[0198] The GTBUpdate register is a 128-bit memory-mapped location, towhich a write operation performs the operation defined above. A readoperation returns a zero value. The format of the GTBUpdateFill registeris identical to that of a GTB entry. FIG. 29 illustrates the registersGTBLast, GTBFirst, and GTBBump. The registers GTBLast, GTBFirst, andGTBBump are memory mapped. As shown in FIG. 29, the GTBLast and GTBFirstregisters are G bits wide, and the GTBBump register is one bit.

[0199]FIG. 30 illustrates a definition for AccessPhysicalGTBRegisters.

[0200] e. Address Generation

[0201] The address units of each of the four threads provide up to twoglobal virtual addresses of load, store, or memory instructions, for atotal of eight addresses. LTB units associated with each threadtranslate the local addresses into global addresses. The LZC operates onglobal addresses. MTB, BTB, and PTB units associated with each threadtranslate the global addresses into physical addresses and cacheaddresses. (A PTB unit associated with each thread produces physicaladdresses and cache addresses for program counter references.—this isoptional, as by limiting address generation to two per thread, the MTBcan be used for program references.) Cache addresses are presented tothe LOC as required, and physical addresses are checked against cachetags as required.

[0202] Rounding and Exceptions

[0203] In accordance with one embodiment of the invention, rounding isspecified within the instructions explicitly, to avoid explicit stateregisters for a rounding mode. Similarly, the instructions explicitlyspecify how standard exceptions (invalid operation, division by zero,overflow, underflow and inexact) are to be handled.

[0204] In this embodiment, when no rounding is explicitly named by theinstruction (default), round to nearest rounding is performed, and allfloating-point exception signals cause the standard-specified defaultresult, rather than a trap. When rounding is explicitly named by theinstruction (N: nearest, Z: zero, F: floor, C: ceiling), the specifiedrounding is performed, and floating-point exception signals other thaninexact cause a floating-point exception trap. When X (exact, orexception) is specified, all floating-point exception signals cause afloating-point exception trap, including inexact. More details regardingrounding and exceptions are described in the “Rounding and Exceptions”section of the Appendix.

[0205] Group Boolean

[0206] In accordance with one embodiment of the invention, the processorhandles a variety Group Boolean operations. For example, FIG. 31Apresents various Group Boolean instructions. FIGS. 31B and 31Cillustrate an exemplary embodiment of a format and operation codes thatcan be used to perform the Boolean instructions shown in FIG. 31A. Asshown in FIGS. 31B and 31C, in this exemplary embodiment, three valuesare taken from the contents of registers rd, rc and rb. The ih and ilfields specify a function of three bits, producing a single bit result.The specified function is evaluated for each bit position, and theresults are catenated and placed in register rd. Register rd is both asource and destination of this instruction.

[0207] The function is specified by eight bits, which give the resultfor each possible value of the three source bits in each bit position: d1 1 1 1 0 0 0 0 C 1 1 0 0 1 1 0 0 b 1 0 1 0 1 0 1 0 f(d,c,b) f₇ f₆ f₅ f₄f₃ f₂ f₁ f₀

[0208] A function can be modified by rearranging the bits of theimmediate value. The table below shows how rearrangement of immediatevalue f_(7 . . . 0) can reorder the operands d,c,b for the samefunction. operation immediate f(d,c,b) f₇ f₆ f₅ f₄ f₃ f₂ f₁ f₀ f(c,d,b)f₇ f₆ f₃ f₂ f₅ f₄ f₁ f₀ f(d,b,c) f₇ f₅ f₆ f₄ f₃ f₁ f₂ f₀ f(b,c,d) f₇ f₃f₅ f₁ f₆ f₂ f₄ f₀ f(c,b,d) f₇ f₅ f₃ f₁ f₆ f₄ f₂ f₀ f(b,d,c) f₇ f₃ f₆ f₂f₅ f₁ f₄ f₀

[0209] By using such a rearrangement, an operation of the form:b=ƒ(d,c,b) can be recoded into a legal form: b=ƒ(b,d,c). For example,the function: b=ƒ(d,c,b)=d?c:b cannot be coded, but the equivalentfunction: d=c?b:d can be determined by rearranging the code ford=ƒ(d,c,b)=d?c:b, which is 11001010, according to the rule for ƒ(d,c,b)

ƒ(c,b,d), to the code 11011000.

[0210] Encoding—Some special characteristics of this rearrangement isthe basis of the manner in which the eight function specification bitsare compressed to seven immediate bits in this instruction. As seen inthe table above, in the general case, a rearrangement of operands fromƒ(d,c,b) to ƒ(d,b,c).(interchanging rc and rb) requires interchangingthe values of f₆ and f₅ and the values of f₂ and f₁.

[0211] Among the 256 possible functions which this instruction canperform, one quarter of them (64 functions) are unchanged by thisrearrangement. These functions have the property that f₆=f₅ and f₂=f₁.The values of rc and rb can be freely interchanged, and so are sortedinto rising or falling order to indicate the value of f₂. Thesefunctions are encoded by the values of f₇, f₆, f₄, f₃, and f₀ in theimmediate field and f₂ by whether rc>rb, thus using 32 immediate valuesfor 64 functions.

[0212] Another quarter of the functions have f₆=1 and f₅=0. Thesefunctions are recoded by interchanging rc and rb, f₆ and f₅, f₂ and f₁.They then share the same encoding as the quarter of the functions wheref₆=0 and f₅=1, and are encoded by the values of f₇, f₄, f₃, f₂, f₁, andf₀ in the immediate field, thus using 64 immediate values for 128functions.

[0213] The remaining quarter of the functions have f₆=f₅ and f₂≠f₁. Thehalf of these in which f₂=1 and f₁=0 are recoded by interchanging rc andrb, f₆ and f₅, f₂ and f₁ They then share the same encoding as the eighthof the functions where f₂=0 and f₁=1, and are encoded by the values off₇, f₆, f₄, f₃, and f₀ in the immediate field, thus using 32 immediatevalues for 64 functions.

[0214] The function encoding is summarized by the table: f₇ f₆ f₅ f₄ f₃f₂ f₁ f₀ trc>trb ih il₅ il₄ il₃ il₂ il₁ il₀ rc rb f₆ f₂  f₂ 0 0 f₆ f₇ f₄f₃ f₀ trc trb f₆ f₂ ˜f₂ 0 0 f₆ f₇ f₄ f₃ f₀ trb trc f₆ 0 1 0 1 f₆ f₇ f₄f₃ f₀ trc trb f₆ 1 0 0 1 f₆ f₇ f₄ f₃ f₀ trb trc 0 1 1 f₂ f₁ f₇ f₄ f₃ f₀trc trb 1 0 1 f₁ f₂ f₇ f₄ f₃ f₀ trb trc

[0215] The function decoding is summarized by the table: ih il₅ il₄ il₃il₂ il₁ il₀ rc>rb f₇ f₆ f₅ f₄ f₃ f₂ f₁ f₀ 0 0 0 il₃ il₄ il₄ il₂ il₁ 0 0il₀ 0 0 1 il₃ il₄ il₄ il₂ il₁ 1 1 il₀ 0 1 il₃ il₄ il₄ il₂ il₁ 0 1 il₀ 1il₃ 0 1 il₂ il₁ il₅ il₄ il₀

[0216] Group Multiplex

[0217] In accordance with one embodiment of the invention, the processorhandles group multiplex operations. FIGS. 31D and 31E illustrate anexemplary embodiment of a format and operation codes that can be used toperform the various Group Multiplex instructions. As shown in FIGS. 31Dand 31E, in this exemplary embodiment, the contents of registers rd, rcand rb are fetched. Each bit of the result is equal to the correspondingbit of rc, if the corresponding bit of rd is set, otherwise it is thecorresponding bit of rb. The result is placed into register ra. Whilethe use of three operand registers and a different result register isdescribed here and elsewhere in the present specification, otherarrangements, such as the use of immediate values, may also beimplemented.

[0218] The table marked Redundancies in FIG. 31D illustrates that forparticular values of the register specifiers, the Group Multplexoperation-performs operations otherwise available within the GroupBoolean instructions. More specifically, when the result register ra isalso present as a source register in the first, second or third sourceoperand position of the operation, the operation is equivalent to theGroup Boolean instruction with arguments of 0×1001010, 0×11100010, or0×11011000 respectively. When the first source operand is the same asthe second or third source operand, the Group Multiplex operation isequivalent to a bitwise OR or AND operation respectively.

[0219] Group Add

[0220] In accordance with one embodiment of the invention, the processorhandles a variety of fixed-point, or integer, group operations. Forexample, FIG. 32A presents various examples of Group Add instructionsaccommodating different operand sizes, such as a byte (8 bits), doublet(16 bits), quadlet (32 bits), octlet (64 bits), and hexlet (128 bits).FIGS. 32B and 32C illustrate an exemplary embodiment of a format andoperation codes that can be used to perform the various Group Addinstructions shown in FIG. 32A. As shown in FIGS. 32B and 32C, in thisexemplary embodiment, the contents of registers rc and rb arepartitioned into groups of operands of the size specified and added, andif specified, checked for overflow or limited, yielding a group ofresults, each of which is the size specified. The group of results iscatenated and placed in register rd. While the use of two operandregisters and a different result register is described here andelsewhere in the present specification, other arrangements, such as theuse of immediate values, may also be implemented.

[0221] In the present embodiment, for example, if the operand sizespecified is a byte (8 bits), and each register is 128-bit wide, thenthe content of each register may be partitioned into 16 individualoperands, and 16 different individual add operations may take place asthe result of a single Group Add instruction. Other instructionsinvolving groups of operands may perform group operations in a similarfashion.

[0222] Group Subtract

[0223] Similarly, FIG. 33A presents various examples of Group Subtractinstructions accommodating different operand sizes. FIGS. 33B and 33Cillustrate an exemplary embodiment of a format and operation codes thatcan be used to perform the various Group Subtract instructions. As shownin FIGS. 33B and 33C, in this exemplary embodiment, the contents ofregisters rc and rb are partitioned into groups of operands of the sizespecified and subtracted, and if specified, checked for overflow orlimited, yielding a group of results, each of which is the sizespecified. The group of results is catenated and placed in register rd.

[0224] Group Set

[0225]FIG. 33A also presents various examples of Group Set instructionsaccommodating different operand sizes. FIG. 33A also presents additionalpseudo-instructions which are equivalent to other Group Set instructionsaccording to the mapping rules further presented in FIG. 33A. FIGS. 33Band 33C illustrate an exemplary embodiment of a format and operationcodes that can be used to perform the various Group Set instructions. Asshown in FIGS. 33B and 33C, in this exemplary embodiment, the contentsof registers rc and rb are partitioned into groups of operands of thesize specified and the specified comparisons are performed, eachproducing a Boolean result repeated to the size specified, yielding agroup of results, each of which is the size specified. The group ofresults is catenated and placed in register rd. In the presentembodiment, certain comparisons between two identically specifiedregisters, for which the result of such comparisons would be predictableno matter what the contents of the register, are used to encodecomparisons against a zero value.

[0226] Combination of Group Set and Boolean operations

[0227] In an embodiment of the invention, conditional operations areprovided in the sense that the set on condition operations can be usedto construct bit masks that can select between alternate vectorexpressions, using the bitwise Boolean operations.

[0228] Ensemble Divide/Multiply

[0229] Embodiments of the invention provide for other fixed-point groupoperations also. FIG. 34A presents various examples of Ensemble Divideand Ensemble Multiply instructions accommodating different operandsizes. FIGS. 34B and 34C illustrate an exemplary embodiment of a formatand operation codes that can be used to perform the various EnsembleDivide and Ensemble Multiply instructions. As shown in FIGS. 34B and34C, in this exemplary embodiment, the contents of registers rc and rbare partitioned into groups of operands of the size specified anddivided or multiplied, yielding a group of results. The group of resultsis catenated and placed in register rd.

[0230] Group Compare

[0231]FIG. 35A present various examples of Group Compare instructionsaccommodating different operand sizes. FIGS. 35B and 35C illustrate anexemplary embodiment of a format and operational codes that can be usedto perform the various Group Compare instructions. As shown in FIGS. 35Band 35C, in this exemplary embodiment, these operations performcalculations on partitions of bits in two general register values, andgenerate a fixed-point arithmetic exception if the condition specifiedis met. Two values are taken from the contents of registers rd and rc.The specified condition is calculated on partitions of the operands. Ifthe specified condition is true for any partition, a fixed-pointarithmetic exception is generated.

[0232] Ensemble Unary

[0233]FIG. 36A present various examples of Ensemble Unary instructionsaccommodating different operand sizes. FIGS. 36B and 36C illustrate anexemplary embodiment of a format and operational codes that can be usedto perform the various Ensemble Unary instructions. As shown in FIGS.36B and 36C, in this exemplary embodiment, these operations takeoperands from a register, perform operations on partitions of bits inthe operand, and place the concatenated results in a second register.Values are taken from the contents of register rc. The specifiedoperation is performed, and the result is placed in register rd. Thecode E.SUM.U.1 in FIG. 36A is preferably encoded as E.SUM.U.128.

[0234] Ensemble Floating-Point Add, Divide, Multiply, and Subtract

[0235] In accordance with one embodiment of the invention, the processoralso handles a variety floating-point group operations accommodatingdifferent operand sizes. Here, the different operand sizes may representfloating-point operands of different precisions, such as half-precision(16 bits), single-precision (32 bits), double-precision (64 bits), andquad-precision (128 bits). FIG. 37 illustrates exemplary functions thatare defined for use within the detailed instruction definitions in othersections and figures. In the functions set forth in FIG. 37, an internalformat represents infinite-precision floating-point values as afour-element structure consisting of (1) s (sign bit): 0 for positive, 1for negative, (2) t (type): NORM, ZERO, SNAN, QNAN, INFINITY, (3) e(exponent), and (4) f: (fraction). The mathematical interpretation of anormal value places the binary point at the units of the fraction,adjusted by the exponent: (−1){circumflex over ( )}s*(2{circumflex over( )}e)*f. The function F converts a packed IEEE floating-point valueinto internal format. The function PackF converts an internal formatback into IEEE floating-point format, with rounding and exceptioncontrol.

[0236]FIGS. 38A and 39A present various examples of Ensemble FloatingPoint Add, Divide, Multiply, and Subtract instructions. FIGS. 38B-C and39B-C illustrate an exemplary embodiment of formats and operation codesthat can be used to perform the various Ensemble Floating Point Add,Divide, Multiply, and Subtract instructions. In these examples, EnsembleFloating Point Add, Divide, and Multiply instructions have been labeledas “EnsembleFloatingPoint.” Also, Ensemble Floating-Point Subtractinstructions have been labeled as “EnsembleReversedFloatingPoint.” Asshown in FIGS. 38B-C and 39B-C, in this exemplary embodiment, thecontents of registers rc and rb are partitioned into groups of operandsof the size specified, and the specified group operation is performed,yielding a group of results. The group of results is catenated andplaced in register rd.

[0237] In the present embodiment, the operation is rounded using thespecified rounding option or using round-to-nearest if not specified. Ifa rounding option is specified, the operation raises a floating-pointexception if a floating-point invalid operation, divide by zero,overflow, or underflow occurs, or when specified, if the result isinexact. If a rounding option is not specified, floating-pointexceptions are not raised, and are handled according to the defaultrules of IEEE 754.

[0238] Ensemble Multiply-Add Floating-Point

[0239]FIG. 38D present various examples of Ensemble Floating PointMultiply Add instructions. FIGS. 38E-F illustrate an exemplaryembodiment of formats and operation codes that can be used to performthe various Ensemble Floating Point Multiply Add instructions. In theseexamples, Ensemble Floating Point Multiply Add instructions have beenlabeled as “EnsembleInplaceFloatingPoint.” As shown in FIGS. 38E-F, inthis exemplary embodiment, operations take operands from threeregisters, perform operations on partitions of bits in the operands, andplace the concatenated results in the third register. Specifically, thecontents of registers rd, rc and rb are partitioned into groups ofoperands of the size specified, and for each partitioned element, thecontents of registers rc and rb are multiplied and added to the contentsof register rd, yielding a group of results. The group of results iscatenated and placed in register rd. Register rd is both a source anddestination of this instruction.

[0240] In the present embodiment, the operation is rounded using thespecified rounding option or using round-to-nearest if not specified. Ifa rounding option is specified, the operation raises a floating-pointexception if a floating-point invalid operation, divide by zero,overflow, or underflow occurs, or when specified, if the result isinexact. If a rounding option is not specified, floating-pointexceptions are not raised, and are handled according to the defaultrules of IEEE 754.

[0241] Group Scale-Add Floating-Point

[0242]FIG. 38G present various examples of Ensemble Floating Point ScaleAdd instructions. FIGS. 38H-I illustrate an exemplary embodiment offormats and operation codes that can be used to perform the variousEnsemble Floating Point Scale Add instructions. In these examples,Ensemble Floating Point Scale Add instructions have been labeled as“EnsembleTemaryFloatingPoint.” As shown in FIGS. 38E-F, in thisexemplary embodiment, the contents of registers rd and rc are taken torepresent a group of floating-point operands. Operands from register rdare multiplied with a floating-point operand taken from theleast-significant bits of the contents of register rb and added tooperands from register rc multiplied with a floating-point operand takenfrom the next least-significant bits of the contents of register rb. Theresults are concatenated and placed in register ra. In an exemplaryembodiment, the results are rounded to the nearest representablefloating-point value in a single floating-point operation. In anexemplary embodiment, floating-point exceptions are not raised, and arehandled according to the default rules of IEEE b 754. In an exemplaryembodiment, these instructions cannot select a directed rounding mode ortrap on inexact.

[0243] Group Set Floating-Point

[0244]FIG. 39D also presents various examples of Group SetFloating-point instructions accommodating different operand sizes. FIG.39E also presents additional pseudo-instructions which are equivalent toother Group Set Floating-Point instructions according to the mappingrules further presented in FIG. 39E. FIGS. 39F and 39G illustrate anexemplary embodiment of a format and operation codes that can be used toperform the various Group Set instructions. As shown in FIGS. 39G, inthis exemplary embodiment, the contents of registers rc and rb arepartitioned into groups of operands of the size specified and thespecified comparisons are performed, each producing a Boolean resultrepeated to the size specified, yielding a group of results, each ofwhich is the size specified. The group of results is catenated andplaced in register rd. If a rounding mode is specified a floating-pointexception is raised if any operand is a SNAN, or when performing a Lessor Greater Equal comparison, any operand is a QNAN. If a rounding optionis not specified, floating-point exceptions are not raised, and arehandled according to the default rules of IEEE b 754.

[0245] Group Compare Floating-point

[0246]FIG. 40A present various examples of Group Compare Floating-pointinstructions accommodating different operand sizes. FIGS. 40B and 40Cillustrate an exemplary embodiment of a format and operational codesthat can be used to perform the various Group Compare Floating-pointinstructions. As shown in FIGS. 40B and 40C, in this exemplaryembodiment, these operations perform calculations on partitions of bitsin two general register values, and generate a floating-point arithmeticexception if the condition specified is met. The contents of registersrd and rc are compared using the specified floating-point condition. Ifthe result of the comparison is true for any corresponding pair ofelements, a floating-point exception is raised. If a rounding option isspecified, the operation raises a floating-point exception if afloating-point invalid operation occurs. If a rounding option is notspecified, floating-point exceptions are not raised, and are handledaccording to the default rules of IEEE b 754.

[0247] Ensemble Unary Floating-point

[0248]FIG. 41A present various examples of Ensemble Unary Floating-pointinstructions accommodating different operand sizes. FIGS. 41B and 41Cillustrate an exemplary embodiment of a format and operational codesthat can be used to perform the various Ensemble Unary Floating-pointinstructions. As shown in FIGS. 41B and 41C, in this exemplaryembodiment, these operations take one value from a register, perform agroup of floating-point arithmetic operations on partitions of bits inthe operands, and place the concatenated results in a register. Thecontents of register rc is used as the operand of the specifiedfloating-point operation. The result is placed in register rd. Theoperation is rounded using the specified rounding option or usinground-to-nearest if not specified. If a rounding option is specified,unless default exception handling is specified, the operation raises afloating-point exception if a floating-point invalid 5 operation, divideby zero, overflow, or underflow occurs, or when specified, if the resultis inexact. If a rounding option is not specified or if defaultexception handling is specified, floating-point exceptions are notraised, and are handled according to the default rules of IEEE b 754.The reciprocal estimate and reciprocal square root estimate instructionscompute an exact result for half precision, and a result with at least12 bits of significant precision for larger formats.

[0249] Ensemble Multiply Galois Field

[0250] In accordance with one embodiment of the invention, the processorhandles different Galois filed operations. For example, FIG. 42Apresents various examples of Ensemble Multiply Galois Field instructionsaccommodating different operand sizes. FIGS. 42B and 42C illustrate anexemplary embodiment of a format and operation codes that can be used toperform the Ensemble Multiply Galois Field instructions shown in FIG.42A. As shown in FIGS. 42B and 32C, in this exemplary embodiment, thecontents of registers rd, rc, and rb are fetched. The specifiedoperation is performed on these operands. The result is placed intoregister ra.

[0251] The contents of registers rd and rc are partitioned into groupsof operands of the size specified and multiplied in the manner ofpolynomials. The group of values is reduced modulo the polynomialspecified by the contents of register rb, yielding a group of results,each of which is the size specified. The group of results is catenatedand placed in register ra.

[0252] An ensemble multiply Galois field bytes instruction (E.MULG. 8)multiplies operand [d15 d14 d13 d12 d11 d10 d9 d8 d7 d6 d5 d4 d3 d2 d₁d0] by operand [c15 c14 c13 c12 c11 c10 c9 c8 c7 c6 c5 c4 c3 c2 c1 c0],modulo polynomial [q], yielding the results [(d15 c15 mod q) (d14 c14mod q) . . . (d0c0 mod q), as illustrated in FIG. 42D.

[0253] Compress, Expand, Rotate and Shift

[0254] In one embodiment of the invention, crossbar switch units such asunits 142 and 148 perform data handling operations, as previouslydiscussed. As shown in FIG. 43A, such data handling operations mayinclude various examples of Crossbar Compress, Crossbar Expand, CrossbarRotate, and Crossbar Shift operations. FIGS. 43B and 43 C illustrate anexemplary embodiment of a format and operation codes that can be used toperform the various Crossbar Compress, Crossbar Expand, Crossbar Rotate,and Crossbar Shift instructions. As shown in FIGS. 43B and 43C, in thisexemplary embodiment, the contents of registers rc and rb are obtainedand the contents of register rc is partitioned into groups of operandsof the size specified and the specified operation is performed using ashift amount obtained from the contents of register rb masked to valuesfrom zero to one less than the size specified, yielding a group ofresults. The group of results is catenated and placed in register rd.

[0255] Various Group Compress operations may convert groups of operandsfrom higher precision data to lower precision data. An arbitraryhalf-sized sub-field of each bit field can be selected to appear in theresult. For example, FIG. 43D shows an X.COMPRESS.16 rd=rc, 4 operation,which performs a selection of bits 19 . . . 4 of each quadlet in ahexlet.Various Group Shift operations may allow shifting of groups ofoperands by a specified number of bits, in a specified direction, suchas shift right or shift left. As can be seen in FIG. 43C, certain GroupShift Left instructions may also involve clearing (to zero) empty loworder bits associated with the shift, for each operand. Certain GroupShift Right instructions may involve clearing (to zero) empty high orderbits associated with the shift, for each operand. Further, certain GroupShift Right instructions may involve filling empty high order bitsassociated with the shift with copies of the sign bit, for each operand.

[0256] Shift Merge

[0257] In one embodiment of the invention, as shown in FIG. 43E, suchdata handling operations may also include various examples of ShiftMerge operations. FIGS. 43F and 43G illustrate an exemplary embodimentof a format and operation codes that can be used to perform the variousShift Merge instructions. As shown in FIGS. 43F and 43G, in thisexemplary embodiment, the contents of registers rd, and rc are obtainedand the contents of register rd and rc are partitioned into groups ofoperands of the size specified, and the specified operation is performedusing a shift amount obtained from the contents of register rb masked tovalues from zero to one less than the e 4 ° size specified, yielding agroup of results. The group of results is catenated and placed inregister rd. Register rd is both a source and destination of thisinstruction.

[0258] Shift Merge operations may allow shifting of groups of operandsby a specified number of bits, in a specified direction, such as shiftright or shift left. As can be seen in FIG. 43G, certain Shift Mergeoperations may involve filling empty bits associated with the shift withcopies of corresponding bits from the contents of register rd, for eachoperand.

[0259] Compress, Expand, Rotate and Shift Immediate

[0260] In one embodiment of the invention, crossbar switch units such asunits 142 and 148 perform data handling operations, as previouslydiscussed. As shown in FIG. 43H, such data handling operations mayinclude various examples of Crossbar Compress Immediate, Crossbar ExpandImmediate, Crossbar Rotate Immediate, and Crossbar Shift Immediateoperations. FIGS. 43I and 43J illustrate an exemplary embodiment of aformat and operation codes that can be used to perform the variousCrossbar Compress Immediate, Crossbar Expand Immediate, Crossbar RotateImmediate, and Crossbar Shift Immediate instructions. As shown in FIGS.43I and 43J, in this exemplary embodiment, the contents of register rcis obtained and is partitioned into groups of operands of the sizespecified and the specified operation is performed using a shift amountobtained from the instruction masked to values from zero to one lessthan the size specified, yielding a group of results. The group ofresults is catenated and placed in register rd.

[0261] Various Group Compress Immediate operations may convert groups ofoperands from higher precision data to lower precision data. Anarbitrary half-sized sub-field of each bit field can be selected toappear in the result. For example, FIG. 43D shows an X.COMPRESS.16rd=rc, 4 operation, which performs a selection of bits 19 . . . 4 ofeach quadlet in a hexlet. Various Group Shift Immediate operations mayallow shifting of groups of operands by a specified number of bits, in aspecified direction, such as shift right or shift left. As can be seenin FIG. 43J, certain Group Shift Left Immediate instructions may alsoinvolve clearing (to zero) empty low order bits associated with theshift, for each operand. Certain Group Shift Right Immediateinstructions may involve clearing (to zero) empty high order bitsassociated with the shift, for each operand. Further, certain GroupShift Right Immediate instructions may involve filling empty high orderbits associated with the shift with copies of the sign bit, for eachoperand.

[0262] Shift Merge Immediate

[0263] In one embodiment of the invention, as shown in FIG. 43K, suchdata handling operations may also include various examples of ShiftMerge Immediate operations. FIGS. 43L and 43M illustrate an exemplaryembodiment of a format and operation codes that can be used to performthe various Shift Merge Immediate instructions. As shown in FIGS. 43Land 43M, in this exemplary embodiment, the contents of registers rd andrc are obtained and are partitioned into groups of operands of the sizespecified, and the specified operation is performed using a shift amountobtained from the instruction masked to values from zero to one lessthan the size specified, yielding a group of results. The group ofresults is catenated and placed in register rd. Register rd is both asource and destination of this instruction.

[0264] Shift Merge operations may allow shifting of groups of operandsby a specified number of bits, in a specified direction, such as shiftright or shift left. As can be seen in FIG. 43G, certain Shift Mergeoperations may involve filling empty bits associated with the shift withcopies of corresponding bits from the contents of register rd, for eachoperand.

[0265] Crossbar Extract

[0266] In one embodiment of the invention, data handling operations mayalso include a Crossbar Extract instruction. FIGS. 44A and 44Billustrate an exemplary embodiment of a format and operation codes thatcan be used to perform the Crossbar Extract instruction. As shown inFIGS. 44A and 44B, in this exemplary embodiment, the contents ofregisters rd, rc, and rb are fetched. The specified operation isperformed on these operands. The result is placed into register ra.

[0267] The Crossbar Extract instruction allows bits to be extracted fromdifferent operands in various ways. Specifically, bits 31 . . . 0 of thecontents of register rb specifies several parameters which control themanner in which data is extracted, and for certain operations, themanner in which the operation is performed. The position of the controlfields allows for the source position to be added to a fixed controlvalue for dynamic computation, and allows for the lower 16 bits of thecontrol field to be set for some of the simpler extract cases by asingle GCOPYI.128 instruction (see the Appendix). The control fields arefurther arranged so that if only the low order 8 bits are non-zero, a128-bit extraction with truncation and no rounding is performed.:

[0268] The table below describes the meaning of each label: label bitsmeaning fsize 8 field size dpos 8 destination position x 1 reserved s 1signed vs. unsigned n 1 reserved m 1 merge vs. extract l 1 reserved rnd2 reserved gssp 9 group size and source position

[0269] The 9-bit gssp field encodes both the group size, gsize, andsource position, spos, according to the formula gssp=512-4*gsize+spos.The group size, gsize, is a power of two in the range 1 . . . 1.128. Thesource position, spos, is in the range 0 . . . (2*gsize)−1.

[0270] The values in the s, n, m, l, and rnd fields have the followingmeaning: values s n m l rnd 0 unsigned extract 1 signed merge 2 3

[0271] As shown in FIG. 44C, for the X.EXTRACT instruction, when m=0,the parameters are interpreted to select a fields from the catenatedcontents of registers rd and rc, extracting values which are catenatedand placed in register ra. As shown in FIG. 44D, for acrossbar-merge-extract (X.EXTRACT when m=1), the parameters areinterpreted to merge fields from the contents of register rd with thecontents of register rc. The results are catenated and placed inregister ra.

[0272] Ensemble Extract

[0273] In one embodiment of the invention, data handling operations mayalso include an Ensemble Extract instruction. FIGS. 44E, 44F and 44Gillustrate an exemplary embodiment of a format and operation codes thatcan be used to perform the Ensemble Extract instruction. As shown inFIGS. 44F and 44G, in this exemplary embodiment, the contents ofregisters rd, rc, and rb are fetched. The specified operation isperformed on these operands. The result is placed into register ra.

[0274] The Crossbar Extract instruction allows bits to be extracted fromdifferent operands in various ways. Specifically, bits 31 . . . 0 of thecontents of register rb specifies several parameters which control themanner in which data is extracted, and for certain operations, themanner in which the operation is performed. The position of the controlfields allows for the source position to be added to a fixed controlvalue for dynamic computation, and allows for the lower 16 bits of thecontrol field to be set for some of the simpler extract cases by asingle GCOPYI.128 instruction (see the Appendix). The control fields arefurther arranged so that if only the low order 8 bits are non-zero, a128-bit extraction with truncation and no rounding is performed.:

[0275] The table below describes the meaning of each label: label bitsmeaning fsize 8 field size dpos 8 destination position x 1 reserved s 1signed vs. unsigned n 1 complex vs. real multiplication m 1 merge vs.extract or mixed-sign vs. same-sign multiplication l 1 limit: saturationvs. truncation rnd 2 rounding gssp 9 group size and source position

[0276] The 9-bit gssp field encodes both the group size, gsize, andsource position, spos, according to the formula gssp=512-4*gsize+spos.The group size, gsize, is a power of two in the range 1 . . . 128. Thesource position, spos, is in the range 0 . . . (2*gsize)−1.

[0277] The values in the s, n, m, l, and rnd fields have the followingmeaning: values s n m l rnd 0 unsigned real extract/same-sign truncate F1 signed complex merge/mixed-sign saturate Z 2 N 3 C

[0278] As shown in FIG. 44C, for the E.EXTRACT instruction, when m=0,the parameters are interpreted to select a fields from the catenatedcontents of registers rd and rc, extracting values which are catenatedand placed in register ra. As shown in FIG. 44D, for anensemble-merge-extract (E.EXTRACT when m=1), the parameters areinterpreted to merge fields from the contents of register rd with thecontents of register rc. The results are catenated and placed inregister ra. As can be seen from FIG. 44G, the operand portion to theleft of the selected field is treated as signed or unsigned ascontrolled by the s field, and truncated or saturated as controlled bythe t field, while the operand portion to the right of the selectedfield is rounded as controlled by the rnd field.

[0279] Deposit and Withdraw

[0280] As shown in FIG. 45A, in one embodiment of the invention, datahandling operations include various Deposit and Withdraw instructions.FIGS. 45B and 45C illustrate an exemplary embodiment of a format andoperation codes that can be used to perform the various Deposit andWithdraw instructions. As shown in FIGS. 45B and 45C, in this exemplaryembodiment, these operations take operands from a register and twoimmediate values, perform operations on partitions of bits in theoperands, and place the concatenated results in the second register.Specifically, the contents of register rc is fetched, and 7-bitimmediate values are taken from the 2-bit ih and the 6-bit gsfp and gsfsfields. The specified operation is performed on these operands. Theresult is placed into register rd.

[0281]FIG. 45D shows legal values for the ih, gsfp and gsfs fields,indicating the group size to which they apply. The ih, gsfp and gsfsfields encode three values: the group size, the field size, and a shiftamount. The shift amount can also be considered to be the source bitfield position for group-withdraw instructions or the destination bitfield position for group-deposit instructions. The encoding is designedso that combining the gsfp and gsfs fields with a bitwise-and produces aresult which can be decoded to the group size, and so the field size andshift amount can be easily decoded once the group size has beendetermined.

[0282] As shown in FIG. 45E, the crossbar-deposit instructions deposit abit field from the lower bits of each group partition of the source to aspecified bit position in the result. The value is either sign-extendedor zero-extended, as specified. As shown in FIG. 45F, thecrossbar-withdraw instructions withdraw a bit field from a specified bitposition in the each group partition of the source and place it in thelower bits in the result. The value is either sign-extended orzero-extended, as specified.

[0283] Deposit Merge

[0284] As shown in FIG. 45G, in one embodiment of the invention, datahandling operations include various Deposit Merge instructions. FIGS.45H and 45I illustrate an exemplary embodiment of a format and operationcodes that can be used to perform the various Deposit Mergeinstructions. As shown in FIGS. 45H and 45I, in this exemplaryembodiment, these operations take operands from two registers and twoimmediate values, perform operations on partitions of bits in theoperands, and place the concatenated results in the second register.Specifically, the contents of registers rc and rd are fetched, and 7-bitimmediate values are taken from the 2-bit ih and the 6-bit gsfp and gsfsfields. The specified operation is performed on these operands. Theresult is placed into register rd.

[0285]FIG. 45D shows legal values for the ih, gsfp and gsfs fields,indicating the group size to which they apply. The ih, gsfp and gsfsfields encode three values: the group size, the field size, and a shiftamount. The shift amount can also be considered to be the source bitfield position for group-withdraw instructions or the destination bitfield position for group-deposit instructions. The encoding is designedso that combining the gsfp and gsfs fields with a bitwise-and produces aresult which can be decoded to the group size, and so the field size andshift amount can be easily decoded once the group size has beendetermined.

[0286] As shown in FIG. 45J, the crossbar-deposit-merge instructionsdeposit a bit field from the lower bits of each group partition of thesource to a specified bit position in the result. The value is mergedwith the contents of register rd at bit positions above and below thedeposited bit field. No sign- or zero-extension is performed by thisinstruction.

[0287] Shuffle

[0288] As shown in FIG. 46A, in one embodiment of the invention, datahandling operations may also include various Shuffle instructions, whichallow the contents of registers to be partitioned into groups ofoperands and interleaved in a variety of ways. FIGS. 46B and 46Cillustrate an exemplary embodiment of a format and operation codes thatcan be used to perform the various Shuffle instructions. As shown inFIGS. 46B and 46C, in this exemplary embodiment, one of two operationsis performed, depending on whether the rc and rb fields are equal. Also,FIG. 46B and the description below illustrate the format of andrelationship of the rd, rc, rb, op, v, w, h, and size fields.

[0289] In the present embodiment, if the rc and rb fields are equal, a128-bit operand is taken from the contents of register rc. Items of sizev are divided into w piles and shuffled together, within groups of sizebits, according to the value of op. The result is placed in register rd.

[0290]FIG. 46C illustrates that for this operation, values of threeparameters x, y, and z are computed depending on the value of op, and ineach result bit position i, a source bit position within the contents ofregister rc is selected, wherein the source bit position is thecatenation of four fields, the first and fourth fields containing fieldsof i which are unchanged: 6 . . . x and y−1 . . . 0, and the second andthird fields containing a subfield of i, bits x−1 . . . y which isrotated by an amount z: y+z−1 . . . y and x−1 . . . y+z.

[0291] Further, if the rc and rb fields are not equal, the contents ofregisters rc and rb are catenated into a 256-bit operand. Items of sizev are divided into w piles and shuffled together, according to the valueof op. Depending on the value of h, a sub-field of op, the low 128 bits(h=0), or the high 128 bits (h=1) of the 256-bit shuffled contents areselected as the result. The result is placed in register rd.

[0292]FIG. 46C illustrates that for this operation, the value of x isfixed, and values of two parameters y and z are computed depending onthe value of op, and in each result bit position i, a source bitposition within the contents of register rc is selected, wherein thesource bit position is the catenation of three fields, the first fieldcontaining a fields of i which is unchanged: y−1 . . . 0, and the secondand third fields containing a subfield of i, bits x−1 . . . y which isrotated by an amount z: y+z−1 . . . y and x−1 . . . y+z.

[0293] As shown in FIG. 46D, an example of a crossbar 4-way shuffle ofbytes within hexlet instruction (X.SHUFFLE.128 rd=rcb, 8,4) may dividethe 128-bit operand into 16 bytes and partitions the bytes 4 ways(indicated by varying shade in the diagram below). The 4 partitions areperfectly shuffled, producing a 128-bit result. As shown in FIG. 46E, anexample of a crossbar 4-way shuffle of bytes within triclet instruction(X.SHUFFLE.256 rd=rc,rb, 8,4,0) may catenate the contents of rc and rb,then divides the 256-bit content into 32 bytes and partitions the bytes4 ways (indicated by varying shade in the diagram below). The low-orderhalves of the 4 partitions are perfectly shuffled, producing a 128-bitresult.

[0294] Changing the last immediate value h to 1 (X.SHUFFLE.256 rd=rc,rb,8,4,1) may modify the operation to perform the same function on thehigh-order halves of the 4 partitions. When rc and rb are equal, thetable below shows the value of the op field and associated values forsize, v, and w. op size v w 0 4 1 2 1 8 1 2 2 8 2 2 3 8 1 4 4 16 1 2 516 2 2 6 16 4 2 7 16 1 4 8 16 2 4 9 16 1 8 10 32 1 2 11 32 2 2 12 32 4 213 32 8 2 14 32 1 4 15 32 2 4 16 32 4 4 17 32 1 8 18 32 2 8 19 32 1 1620 64 1 2 21 64 2 2 22 64 4 2 23 64 8 2 24 64 16 2 25 64 1 4 26 64 2 427 64 4 4 28 64 8 4 29 64 1 8 30 64 2 8 31 64 4 8 32 64 1 16 33 64 2 1634 64 1 32 35 128 1 2 36 128 2 2 37 128 4 2 38 128 8 2 39 128 16 2 40128 32 2 41 128 1 4 42 128 2 4 43 128 4 4 44 128 8 4 45 128 16 4 46 1281 8 47 128 2 8 48 128 4 8 49 128 8 8 50 128 1 16 51 128 2 16 52 128 4 1653 128 1 32 54 128 2 32 55 128 1 64

[0295] When rc and rb are not equal, the table below shows the value ofthe op_(4 . . . 0) field and associated values for size, v, and w: Op₅is the value of h, which controls whether the low-order or high-orderhalf of each partition is shuffled into the result. op_(4...0) size v w0 256 1 2 1 256 2 2 2 256 4 2 3 256 8 2 4 256 16 2 5 256 32 2 6 256 64 27 256 1 4 8 256 2 4 9 256 4 4 10 256 8 4 11 256 16 4 12 256 32 4 13 2561 8 14 256 2 8 15 256 4 8 16 256 8 8 17 256 16 8 18 256 1 16 19 256 2 1620 256 4 16 21 256 8 16 22 256 1 32 23 256 2 32 24 256 4 32 25 256 1 6426 256 2 64 27 256 1 128

[0296] Swizzle

[0297] In one embodiment of the invention, data handling operations mayalso include various Crossbar Swizzle instruction. FIGS. 47A and 47Billustrate an exemplary embodiment of a format and operation codes thatcan be used to perform Crossbar Swizzle instructions. As shown in FIGS.47A and 47B, in this exemplary embodiment, the contents of register rcare fetched, and 7-bit immediate values, icopy and iswap, areconstructed from the 2-bit ih field and from the 6-bit icopya and iswapafields. The specified operation is performed on these operands. Theresult is placed into register rd.

[0298] The “swizzle” operation can reverse the order of the bit fieldsin a hexlet. For example, a X.SWIZZLE rd=rc, 127,112 operation reversesthe doublets within a hexlet, as shown in FIG. 47C. In some cases, it isdesirable to use a group instruction in which one or more operands is asingle value, not an array. The “swizzle” operation can also copyoperands to multiple locations within a hexlet. For example, a X.SWIZZLE15,0 operation copies the low-order 16 bits to each double within ahexlet.

[0299] Select

[0300] In one embodiment of the invention, data handling operations mayalso include various Crossbar Select instruction. FIGS. 47D and 47Eillustrate an exemplary embodiment of a format and operation codes thatcan be used to perform Crossbar Select instructions. As shown in FIGS.47D and 47E, in this exemplary embodiment, the contents of registers rd,rc and rb are fetched, and the contents of registers rd and rc arecatenated, producing catenated data dc. The contents of register rb ispartitioned into elements, and the value expressed in each partition isemployed to select one partitioned element of the catenated data dc. Theselected elements are catenated together, and result is placed intoregister ra.

[0301] Bus Interface

[0302] According to one embodiment of the invention, an initialimplementation of the processor uses a “Super Socket 7 compatible” (SS7)bus interface, which is generally similar to and compatible with other“Socket 7” and “Super Socket 7” processors. FIG. 48 is a pin summarydescribing the functions of various pins in accordance with the presentembodiment. FIGS. 49A-G contain electrical specifications describing ACand DC parameters in accordance with the present embodiment. Furtherdetails are provided in the “Bus Interface” section of the Appendix.

[0303] Load and Load Immediate

[0304] As shown in FIG. 50A and 51A, in one embodiment of the invention,memory access operations may also include various Load and LoadImmediate instructions. These figures and FIGS. 50B and 51B show thatthe various Load and Load Immediate instructions specify a type ofoperand, either signed, or unsigned, represented by omitting orincluding a U, respectively. The instructions further specify a size ofmemory operand, byte, double, quadlet, octlet, or hexlet, representing8, 16, 32, 64, and 128 bits respectively. The instructions furtherspecify aligned memory operands, or not, represented by including a A,or with the A omitted, respectively. The instructions further specify abyte-ordering of the memory operand, either big-endian, orlittle-endian, represented by B, and L respectively.

[0305] Each instruction specifies the above items with the followingexceptions: L.8, L.U8, L.I.8, L.I.U8 need not distinguish betweenlittle-endian and big-endian ordering, nor between aligned andunaligned, as only a single byte is loaded. L.128.B, L.128.AB, L.128.L,L.128AL, L.I.128.B, L.I.128.AB, L.I.128.L, and L.I.128AL need notdistinguish between signed and unsigned, as the hexlet fills thedestination register.

[0306]FIGS. 50B and 50C illustrate an exemplary embodiment of formatsand operation codes that can be used to perform Load instructions. Asshown in FIGS. 50B and 50C, in this exemplary embodiment, an operandsize, expressed in bytes, is specified by the instruction. A virtualaddress is computed from the sum of the contents of register rc and thesign-extended value of the offset field, multiplied by the operand size.

[0307]FIGS. 51B and 51C illustrate an exemplary embodiment of formatsand operation codes that can be used to perform Load Immediateinstructions. As shown in FIGS. 51B and 51C, in this exemplaryembodiment, an operand size, expressed in bytes, is specified by theinstruction. A virtual address is computed from the sum of the contentsof register rc and the sign-extended value of the offset field,multiplied by the operand size.

[0308] In an exemplary embodiment, for both Load and Load Immediateinstructions, the contents of memory using the specified byte order areread, treated as the size specified, zero-extended or sign-extended asspecified, and placed into register rd. If alignment is specified, thecomputed virtual address must be aligned, that is, it must be an exactmultiple of the size expressed in bytes. If the address is not alignedan “access disallowed by virtual address” exception occurs.

[0309] Store and Store Immediate

[0310] As shown in FIG. 52A and 53A, in one embodiment of the invention,memory access operations may also include various Store and StoreImmediate instructions. These figures and FIGS. 52B and 53B show thatthe various Store and Store Immediate instructions specify a size ofmemory operand, byte, double, quadlet, octlet, or hexlet, representing8, 16, 32, 64, and 128 bits respectively. The instructions furtherspecify aligned memory operands, or not, represented by including a A,or with the A omitted, respectively. The instructions further specify abyte-ordering of the memory operand, either big-endian, orlittle-endian, represented by B, and L respectively.

[0311] Each instruction specifies the above items with the followingexceptions: L.8 and L.I.8 need not distinguish between little-endian andbig-endian ordering, nor between aligned and unaligned, as only a singlebyte is stored.

[0312]FIGS. 52B and 52C illustrate an exemplary embodiment of formatsand operation codes that can be used to perform Store instructions. Asshown in FIGS. 52B and 52C, in this exemplary embodiment, an operandsize, expressed in bytes, is specified by the instruction. A virtualaddress is computed from the sum of the contents of register rc and thecontents of register rb multiplied by operand size.

[0313]FIGS. 53B and 53C illustrate an exemplary embodiment of formatsand operation codes that can be used to perform Store Immediateinstructions. As shown in FIGS. 53B and 53C, in this exemplaryembodiment, an operand size, expressed in bytes, is specified by theinstruction. A virtual address is computed from the sum of the contentsof register rc and the sign-extended value of the offset field,multiplied by the operand size.

[0314] In an exemplary embodiment, for both Store and Store Immediateinstructions, the contents of register rd, treated as the sizespecified, is stored in memory using the specified byte order. Ifalignment is specified, the computed virtual address must be aligned,that is, it must be an exact multiple of the size expressed in bytes. Ifthe address is not aligned an “access disallowed by virtual address”exception occurs.

[0315] Store Multiplex and Store Multiplex Immediate

[0316] As shown in FIG. 52A and 53A, in one embodiment of the invention,memory access operations may also include various Store Multiplex andStore Multiplex Immediate instructions. These figures and FIGS. 52B and53B show that the various Store Multiplex and Store Multiplex Immediateinstructions specify a size of memory operand, octlet, representing 64bits. The instructions further specify aligned memory operands,represented by including a A. The instructions further specify abyte-ordering of the memory operand, either big-endian, orlittle-endian, represented by B, and L respectively.

[0317]FIGS. 52B and 52C illustrate an exemplary embodiment of formatsand operation codes that can be used to perform Store Multiplexinstructions. As shown in FIGS. 52B and 52C, in this exemplaryembodiment, an operand size, expressed in bytes, is specified by theinstruction. A virtual address is computed from the sum of the contentsof register rc and the contents of register rb multiplied by operandsize.

[0318]FIGS. 53B and 53C illustrate an exemplary embodiment of formatsand operation codes that can be used to perform Store MultiplexImmediate instructions. As shown in FIGS. 53B and 53C, in this exemplaryembodiment, an operand size, expressed in bytes, is specified by theinstruction. A virtual address is computed from the sum of the contentsof register rc and the sign-extended value of the offset field,multiplied by the operand size.

[0319] In an exemplary embodiment, for both Store Multiplex and StoreMultiplex Immediate instructions, data contents and mask contents of thecontents of register rd are identified. The data contents are stored inmemory using the specified byte order for values in which thecorresponding mask contents are set. In an exemplary embodiment, it canbe understood that masked writing of data can be accomplished byindivisibly reading the original contents of the addressed memoryoperand, modifying the value, and writing the modified value back to theaddressed memory operand. In an exemplary embodiment, the modificationof the value is accomplished using an operation previously identified asa Multiplex operation in the section titled Group Multiplex, above, andin FIG. 31E.

[0320] In an exemplary embodiment, for both Store Multiplex and StoreMultiplex Immediate instructions, the computed virtual address must bealigned, that is, it must be an exact multiple of the size expressed inbytes. If the address is not aligned an “access disallowed by virtualaddress” exception occurs.

[0321] Additional Load and Execute Resources

[0322] In an exemplary embodiment, studies of the dynamic distributionof instructions on various benchmark suites indicate that the mostfrequently-issued instruction classes are load instructions and executeinstructions. In an exemplary embodiment, it is advantageous to considerexecution pipelines in which the ability to target the machine resourcestoward issuing load and execute instructions is increased.

[0323] In an exemplary embodiment, one of the means to increase theability to issue execute-class instructions is to provide the means toissue two execute instructions in a single-issue string. The executionunit actually requires several distinct resources, so by partitioningthese resources, the issue capability can be increased withoutincreasing the number of functional units, other than the increasedregister file read and write ports. In an exemplary embodiment, thepartitioning favored places all instructions that involve shifting andshuffling in one execution unit, and all instructions that involvemultiplication, including fixed-point and floating-point multiply andadd in another unit. In an exemplary embodiment, resources used forimplementing add, subtract, and bitwise logical operations may beduplicated, being modest in size compared to the shift and multiplyunits. In another exemplary embodiment, resources used are sharedbetween the two units, as the operations have low-enough latency thattwo operations might be pipelined within a single issue cycle. Theseinstructions must generally be independent, except in another exemplaryembodiment that two simple add, subtract, or bitwise logicalinstructions may be performed dependently, if the resources forexecuting simple instructions are shared between the execution units.

[0324] In an exemplary embodiment, one of the means to increase theability to issue load-class instructions is to provide the means toissue two load instructions in a single-issue string. This wouldgenerally increase the resources required of the data fetch unit and thedata cache, but a compensating solution is to steal the resources forthe store instruction to execute the second load instruction. Thus, inan exemplary embodiment, a single-issue string can then contain eithertwo load instructions, or one load instruction and one storeinstruction, which uses the same register read ports and addresscomputation resources as the basic 5 -instruction string in anotherexemplary embodiment.

[0325] In an exemplary embodiment, this capability also may be employedto provide support for unaligned load and store instructions, where asingle-issue string may contain as an alternative a single unalignedload or store instruction which uses the resources of the two load-classunits in concert to accomplish the unaligned memory operation.

[0326] High-Level Language Accessibility

[0327] In one embodiment of the invention, all processor, memory, andinterface resources directly accessible to high-level language programs.In one embodiment, memory is byte-addressed, using either little-endianor big-endian byte ordering. In one embodiment, for consistency with thebit ordering, and for compatibility with ×86 processors, little-endianbyte ordering is used when an ordering must be selected. In oneembodiment, load and store instructions are available for bothlittle-endian and big-endian byte ordering. In one embodiment, interfaceresources are accessible as memory-mapped registers. In one embodiment,system state is memory mapped, so that it can be manipulated by compiledcode.

[0328] In one embodiment, instructions are specified to assemblers andother code tools in the syntax of an instruction mnemonic (operationcode), then optionally white space followed by a list of operands. Inone embodiment, instruction mnemonics listed in this specification arein upper case (capital) letters, assemblers accept either upper case orlower case letters in the instruction mnemonics. In this specification,instruction mnemonics contain periods (“.”) to separate elements to makethem easier to understand; assemblers ignore periods within instructionmnemonics.

[0329] In FIGS. 31B, 31D, 32B, 33B, 34B, 35B, 36B, 38B, 38E, 38H, 39B39F, 40B, 41B, 42B, 43B, 43F, 43I, 43L, 44A, 44F, 45B, 45H, 46B, 51B,52B, and 53B, the format of instructions to be presented to an assembleris illustrated. Following the assembler format, the format for inclusionof instructions into high-level compiled languages is indicated.Finally, the detailed structure of the instruction fields, includingpseudo code used to connect the assembler and compiled formats to theinstruction fields is shown. Further detailed explanation of the formatsand instruction decoding is provided in the Appendix, in the sectiontitled “Instruction Set.”

[0330] In one embodiment, an instruction is specifically defined as afour-byte structure with the little-endian ordering. In one embodiment,instructions must be aligned on four-byte boundaries. In one embodiment,basic floating-point operations supported in hardware are floating-pointadd, subtract, multiply, divide, square root and conversions amongfloating-point formats and between floating-point and binary integerformats. Software libraries provide other operations required by theANSI/IEEE floating-point standard.

[0331] In one embodiment, software conventions are employed at softwaremodule boundaries, in order to permit the combination of separatelycompiled code and to provide standard interfaces between application,library and system software. In one embodiment, register usage andprocedure call conventions may be modified, simplified or optimized whena single compilation encloses procedures within a compilation unit sothat the procedures have no external interfaces. For example, internalprocedures may permit a greater number of register-passed parameters, orhave registers allocated to avoid the need to save registers atprocedure boundaries, or may use a single stack or data pointerallocation to suffice for more than one level of procedure call.

[0332] In one embodiment, at a procedure call boundary, registers aresaved either by the caller or callee procedure, which provides amechanism for leaf procedures to avoid needing to save registers.Compilers may choose to allocate variables into caller or callee savedregisters depending on how their lifetimes overlap with procedure calls.

[0333] In one embodiment, procedure parameters are normally allocated inregisters, starting from register 2 up to register 9. These registershold up to 8 parameters, which may each be of any size from one byte tosixteen bytes (hexlet), including floating-point and small structureparameters. Additional parameters are passed in memory, allocated on thestack. For C procedures which use varargs.h or stdarg.h and passparameters to further procedures, the compilers must leave room in thestack memory allocation to save registers 2 through 9 into memorycontiguously with the additional stack memory parameters, so thatprocedures such as_doprnt can refer to the parameters as an array.Procedure return values are also allocated in registers, starting fromregister 2 up to register 9. Larger values are passed in memory,allocated on the stack.

[0334] In one embodiment, instruction scheduling is performed by acompiler. In the manner of software pipelineing, instructions shouldgenerally be scheduled so that previous operations can be completed atthe time of issue. When this is not possible, the processor insertssufficient empty cycles to perform the instructions precisely-explicitno-operation instructions are not required

[0335] Conclusion

[0336] Having fully described various embodiments of the invention,those skilled in the art will recognize, given the teachings herein,that numerous alternatives and equivalents exist which do not departfrom the invention. It is therefore intended that the invention not belimited by the foregoing description, but only by the appended claims.

We claim:
 1. A method of executing a plurality of threads within asingle programmable processor, the method comprising: receiving aninstruction stream for each one of the plurality of threads at anexecution unit; executing instructions from each instruction streamreceived at the execution unit in a multistage pipeline within theexecution unit such that, at any given time, the multistage pipelineincludes instructions from different ones of the instruction streams indifferent stages of the multistage pipeline, the instructions includinga single instruction that operates on a plurality of data elements inpartitioned fields of at least one register to produce a catenatedresult, the at least one register having a register width and each ofthe data elements having an elemental width smaller than the registerwidth.
 2. The method of claim 1 wherein the number of threads executingwithin the execution unit is prime relative to a rate of execution of aslowest functional unit in the execution unit.
 3. The method of claim 1wherein the instructions from the plurality of instruction streams areexecuted in a round-robin manner.
 4. The method of claim 1 wherein onlyone thread from the plurality of threads can handle an exception at anygiven time.
 5. The method of claim 1 further comprising: decoding asecond single instruction specifying a third and a fourth register eachcontaining a plurality of floating-point operands; multiplying theplurality of floating point operands in the third register by theplurality of operands in the fourth register to produce a plurality orproducts; and providing the plurality of products to partitioned fieldsof a result register as a catenated result.
 6. A computer-readablemedium: having an instruction stream for each one of a plurality ofthreads that instruct a computer system to perform operationscomprising, receiving an instruction stream for each one of theplurality of threads at an execution unit; executing instructions fromeach instruction stream received at the execution unit in a multistagepipeline within the execution unit such that, at any given time, themultistage pipeline includes instructions from different ones of theinstruction streams in different stages of the multistage pipeline, theinstructions including a single instruction that operates on a pluralityof data elements in partitioned fields of at least one register toproduce a catenated result, the at least one register having a registerwidth and each of the data elements having an elemental width smallerthan the register width.
 7. The computer-readable medium of claim 6wherein the number of threads executing within the execution unit isprime relative to a rate of execution of a slowest functional unit inthe execution unit.
 8. The computer-readable medium of claim 6 whereinthe instructions from the plurality of instruction streams are executedin a round-robin manner.
 9. The computer-readable medium of claim 6wherein only one thread from the plurality of threads can handle anexception at any given time.
 10. A computer data signal, embodied in atransmission medium: having an instruction stream for each one of aplurality of threads that instruct a computer system to performoperations comprising, receiving an instruction stream for each one ofthe plurality of threads at an execution unit; executing instructionsfrom each instruction stream received at the execution unit in amultistage pipeline within the execution unit such that, at any giventime, the multistage pipeline includes instructions from different onesof the instruction streams in different stages of the multistagepipeline, the instructions including a single instruction that operateson a plurality of data elements in partitioned fields of at least oneregister to produce a catenated result, wherein the at least oneregister has a register width and each of the data elements has anelemental width smaller than the register width.
 11. The computer datasignal of claim 10 wherein the number of threads executing within theexecution unit is prime relative to a rate of execution of a slowestfunctional unit in the execution unit.
 12. The computer data signal ofclaim 10 wherein the instructions from the plurality of instructionstreams are executed in a round-robin manner.
 13. The computer datasignal of claim 10 wherein only one thread from the plurality of threadscan handle an exception at any given time.
 14. The computer data signalof claim 10 wherein at least some of the instructions further include agroup floating point multiply instruction for multiplying floating pointdata in a programmable processor, the group floating point multiplyinstruction capable of instructing the computer to perform operationscomprising: decoding the group floating point multiply instructionspecifying a third and a fourth register each containing a plurality offloating-point operands; multiplying the plurality of floating pointoperands in the third register by the plurality of operands in thefourth register to produce a plurality or products; and providing theplurality of products to partitioned fields of a result register as acatenated result.